ImportMetaHotDeclineDependency.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 ModuleDependency = require("./ModuleDependency");
  8. const ModuleDependencyTemplateAsId = require("./ModuleDependencyTemplateAsId");
  9. /** @typedef {import("../javascript/JavascriptParser").Range} Range */
  10. class ImportMetaHotDeclineDependency extends ModuleDependency {
  11. /**
  12. * Creates an instance of ImportMetaHotDeclineDependency.
  13. * @param {string} request the request string
  14. * @param {Range} range location in source code
  15. */
  16. constructor(request, range) {
  17. super(request);
  18. this.range = range;
  19. this.weak = true;
  20. }
  21. get type() {
  22. return "import.meta.webpackHot.decline";
  23. }
  24. get category() {
  25. return "esm";
  26. }
  27. }
  28. makeSerializable(
  29. ImportMetaHotDeclineDependency,
  30. "webpack/lib/dependencies/ImportMetaHotDeclineDependency"
  31. );
  32. ImportMetaHotDeclineDependency.Template = ModuleDependencyTemplateAsId;
  33. module.exports = ImportMetaHotDeclineDependency;