main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[79a0317] | 1 | /*
|
---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
| 3 | Author Ivan Kopeykin @vankop
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | "use strict";
|
---|
| 7 |
|
---|
| 8 | const makeSerializable = require("../util/makeSerializable");
|
---|
| 9 | const ContextDependency = require("./ContextDependency");
|
---|
| 10 | const ModuleDependencyTemplateAsRequireId = require("./ModuleDependencyTemplateAsRequireId");
|
---|
| 11 |
|
---|
| 12 | /** @typedef {import("../javascript/JavascriptParser").Range} Range */
|
---|
| 13 | /** @typedef {import("./ContextDependency").ContextDependencyOptions} ContextDependencyOptions */
|
---|
| 14 |
|
---|
| 15 | class ImportMetaContextDependency extends ContextDependency {
|
---|
| 16 | /**
|
---|
| 17 | * @param {ContextDependencyOptions} options options
|
---|
| 18 | * @param {Range} range range
|
---|
| 19 | */
|
---|
| 20 | constructor(options, range) {
|
---|
| 21 | super(options);
|
---|
| 22 |
|
---|
| 23 | this.range = range;
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | get category() {
|
---|
| 27 | return "esm";
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | get type() {
|
---|
| 31 | return `import.meta.webpackContext ${this.options.mode}`;
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
| 34 |
|
---|
| 35 | makeSerializable(
|
---|
| 36 | ImportMetaContextDependency,
|
---|
| 37 | "webpack/lib/dependencies/ImportMetaContextDependency"
|
---|
| 38 | );
|
---|
| 39 |
|
---|
| 40 | ImportMetaContextDependency.Template = ModuleDependencyTemplateAsRequireId;
|
---|
| 41 |
|
---|
| 42 | module.exports = ImportMetaContextDependency;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.