ExportWebpackRequireRuntimeModule.js 643 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. */
  4. "use strict";
  5. const RuntimeGlobals = require("../RuntimeGlobals");
  6. const RuntimeModule = require("../RuntimeModule");
  7. class ExportWebpackRequireRuntimeModule extends RuntimeModule {
  8. constructor() {
  9. super("export webpack runtime", RuntimeModule.STAGE_ATTACH);
  10. }
  11. /**
  12. * @returns {boolean} true, if the runtime module should get it's own scope
  13. */
  14. shouldIsolate() {
  15. return false;
  16. }
  17. /**
  18. * @returns {string | null} runtime code
  19. */
  20. generate() {
  21. return `export default ${RuntimeGlobals.require};`;
  22. }
  23. }
  24. module.exports = ExportWebpackRequireRuntimeModule;