webpack/lib/dependencies/ImportMetaHotDeclineDepende...

43 lines
990 B
JavaScript
Raw Normal View History

2020-06-22 23:49:57 +08:00
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
const makeSerializable = require("../util/makeSerializable");
const ModuleDependency = require("./ModuleDependency");
const ModuleDependencyTemplateAsId = require("./ModuleDependencyTemplateAsId");
2023-05-22 04:31:30 +08:00
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
2020-06-22 23:49:57 +08:00
class ImportMetaHotDeclineDependency extends ModuleDependency {
2023-05-22 04:31:30 +08:00
/**
* @param {string} request the request string
* @param {Range} range location in source code
*/
2020-06-22 23:49:57 +08:00
constructor(request, range) {
super(request);
this.range = range;
this.weak = true;
}
get type() {
return "import.meta.webpackHot.decline";
2020-06-22 23:49:57 +08:00
}
get category() {
return "esm";
}
}
makeSerializable(
ImportMetaHotDeclineDependency,
"webpack/lib/dependencies/ImportMetaHotDeclineDependency"
);
ImportMetaHotDeclineDependency.Template = ModuleDependencyTemplateAsId;
module.exports = ImportMetaHotDeclineDependency;