UNPKG

webpack

Version:

Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.

45 lines (34 loc) • 1.26 kB
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ "use strict"; const makeSerializable = require("../../util/makeSerializable"); const ModuleDependencyTemplateAsRequireId = require("../core/ModuleDependencyTemplateAsRequireId"); const ContextDependency = require("./ContextDependency"); /** @import { Range } from "../../javascript/JavascriptParser" */ /** @import { ContextDependencyOptions } from "./ContextDependency" */ class ImportMetaContextDependency extends ContextDependency { /** * Creates an instance of ImportMetaContextDependency. * @param {ContextDependencyOptions} options options * @param {Range} range range */ constructor(options, range) { super(options); this.range = range; } get category() { return "esm"; } get type() { return `import.meta.webpackContext ${this.options.mode}`; } } makeSerializable(ImportMetaContextDependency, [ "webpack/lib/dependencies/context/ImportMetaContextDependency", // TODO in the next major release: remove, they restore pre-move cache packs "webpack/lib/dependencies/ImportMetaContextDependency" ]); ImportMetaContextDependency.Template = ModuleDependencyTemplateAsRequireId; module.exports = ImportMetaContextDependency;