RequireContextDependency.js 880 B

12345678910111213141516171819202122232425262728293031323334353637
  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. /** @typedef {import("../javascript/JavascriptParser").Range} Range */
  10. class RequireContextDependency extends ContextDependency {
  11. /**
  12. * @param {TODO} options options
  13. * @param {Range} range range
  14. */
  15. constructor(options, range) {
  16. super(options);
  17. this.range = range;
  18. }
  19. get type() {
  20. return "require.context";
  21. }
  22. }
  23. makeSerializable(
  24. RequireContextDependency,
  25. "webpack/lib/dependencies/RequireContextDependency"
  26. );
  27. RequireContextDependency.Template = ModuleDependencyTemplateAsRequireId;
  28. module.exports = RequireContextDependency;