mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-22 16:35:14 +00:00
14 lines
459 B
JavaScript
14 lines
459 B
JavaScript
const { version } = require('webpack');
|
|
|
|
// Parse Webpack's major version: x.y.z => x
|
|
const webpackVersion = parseInt(version || '', 10);
|
|
|
|
let webpackGlobals = {};
|
|
if (webpackVersion === 5) {
|
|
webpackGlobals = require('webpack/lib/RuntimeGlobals');
|
|
}
|
|
|
|
module.exports.webpackVersion = webpackVersion;
|
|
module.exports.webpackRequire = webpackGlobals.require || '__webpack_require__';
|
|
module.exports.refreshGlobal = `${module.exports.webpackRequire}.$Refresh$`;
|