ModuleHotAcceptDependency.js 956 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. /** @typedef {import("../javascript/JavascriptParser").Range} Range */
  10. class ModuleHotAcceptDependency extends ModuleDependency {
  11. /**
  12. * @param {string} request the request string
  13. * @param {Range} range location in source code
  14. */
  15. constructor(request, range) {
  16. super(request);
  17. this.range = range;
  18. this.weak = true;
  19. }
  20. get type() {
  21. return "module.hot.accept";
  22. }
  23. get category() {
  24. return "commonjs";
  25. }
  26. }
  27. makeSerializable(
  28. ModuleHotAcceptDependency,
  29. "webpack/lib/dependencies/ModuleHotAcceptDependency"
  30. );
  31. ModuleHotAcceptDependency.Template = ModuleDependencyTemplateAsId;
  32. module.exports = ModuleHotAcceptDependency;