globals.js 459 B

12345678910111213
  1. const { version } = require('webpack');
  2. // Parse Webpack's major version: x.y.z => x
  3. const webpackVersion = parseInt(version || '', 10);
  4. let webpackGlobals = {};
  5. if (webpackVersion === 5) {
  6. webpackGlobals = require('webpack/lib/RuntimeGlobals');
  7. }
  8. module.exports.webpackVersion = webpackVersion;
  9. module.exports.webpackRequire = webpackGlobals.require || '__webpack_require__';
  10. module.exports.refreshGlobal = `${module.exports.webpackRequire}.$Refresh$`;