ImportMetaContextDependency.js 818 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Ivan Kopeykin @vankop
  4. */
  5. "use strict";
  6. const makeSerializable = require("../util/makeSerializable");
  7. const ContextDependency = require("./ContextDependency");
  8. const ModuleDependencyTemplateAsRequireId = require("./ModuleDependencyTemplateAsRequireId");
  9. class ImportMetaContextDependency extends ContextDependency {
  10. constructor(options, range) {
  11. super(options);
  12. this.range = range;
  13. }
  14. get category() {
  15. return "esm";
  16. }
  17. get type() {
  18. return `import.meta.webpackContext ${this.options.mode}`;
  19. }
  20. }
  21. makeSerializable(
  22. ImportMetaContextDependency,
  23. "webpack/lib/dependencies/ImportMetaContextDependency"
  24. );
  25. ImportMetaContextDependency.Template = ModuleDependencyTemplateAsRequireId;
  26. module.exports = ImportMetaContextDependency;