CommonJsRequireDependency.js 788 B

1234567891011121314151617181920212223242526272829303132333435
  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 ModuleDependency = require("./ModuleDependency");
  8. const ModuleDependencyTemplateAsId = require("./ModuleDependencyTemplateAsId");
  9. class CommonJsRequireDependency extends ModuleDependency {
  10. constructor(request, range, context) {
  11. super(request);
  12. this.range = range;
  13. this._context = context;
  14. }
  15. get type() {
  16. return "cjs require";
  17. }
  18. get category() {
  19. return "commonjs";
  20. }
  21. }
  22. CommonJsRequireDependency.Template = ModuleDependencyTemplateAsId;
  23. makeSerializable(
  24. CommonJsRequireDependency,
  25. "webpack/lib/dependencies/CommonJsRequireDependency"
  26. );
  27. module.exports = CommonJsRequireDependency;