RequireContextDependency.js 733 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const makeSerializable = require("../util/makeSerializable");
  7. const ContextDependency = require("./ContextDependency");
  8. const ModuleDependencyTemplateAsRequireId = require("./ModuleDependencyTemplateAsRequireId");
  9. class RequireContextDependency extends ContextDependency {
  10. constructor(options, range) {
  11. super(options);
  12. this.range = range;
  13. }
  14. get type() {
  15. return "require.context";
  16. }
  17. }
  18. makeSerializable(
  19. RequireContextDependency,
  20. "webpack/lib/dependencies/RequireContextDependency"
  21. );
  22. RequireContextDependency.Template = ModuleDependencyTemplateAsRequireId;
  23. module.exports = RequireContextDependency;