webpack 5.108.4 → 5.109.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/APIPlugin.js +48 -29
- package/lib/CacheFacade.js +8 -0
- package/lib/ChunkGroup.js +1 -0
- package/lib/CompatibilityPlugin.js +31 -29
- package/lib/Compilation.js +49 -4
- package/lib/ConstPlugin.js +11 -11
- package/lib/ContextModule.js +239 -6
- package/lib/ContextModuleFactory.js +139 -14
- package/lib/DefinePlugin.js +396 -101
- package/lib/Entrypoint.js +1 -1
- package/lib/ExportsInfoApiPlugin.js +2 -2
- package/lib/ExternalModule.js +107 -5
- package/lib/ExternalModuleFactoryPlugin.js +20 -1
- package/lib/FileSystemInfo.js +130 -74
- package/lib/HotModuleReplacementPlugin.js +18 -15
- package/lib/Module.js +3 -0
- package/lib/ModuleFilenameHelpers.js +2 -2
- package/lib/ModuleTypeConstants.js +8 -1
- package/lib/MultiCompiler.js +13 -2
- package/lib/MultiWatching.js +1 -0
- package/lib/NodeStuffPlugin.js +51 -33
- package/lib/NormalModule.js +169 -401
- package/lib/NormalModuleFactory.js +76 -2
- package/lib/ProgressPlugin.js +211 -119
- package/lib/ProvidePlugin.js +2 -2
- package/lib/RuntimeGlobals.js +47 -0
- package/lib/RuntimePlugin.js +33 -0
- package/lib/RuntimeTemplate.js +304 -16
- package/lib/UseStrictPlugin.js +1 -1
- package/lib/WebpackIsIncludedPlugin.js +1 -1
- package/lib/WebpackOptionsApply.js +24 -19
- package/lib/asset/AssetGenerator.js +110 -28
- package/lib/asset/AssetModulesPlugin.js +92 -2
- package/lib/asset/WebManifestGenerator.js +164 -0
- package/lib/asset/WebManifestParser.js +130 -0
- package/lib/async-modules/AwaitDependenciesInitFragment.js +14 -4
- package/lib/async-modules/isGeneratorLowered.js +26 -0
- package/lib/cache/PackFileCacheStrategy.js +9 -3
- package/lib/config/browserslistTargetHandler.js +40 -0
- package/lib/config/defaults.js +219 -29
- package/lib/config/normalization.js +26 -0
- package/lib/config/target.js +9 -1
- package/lib/css/CssGenerator.js +40 -31
- package/lib/css/CssLoadingRuntimeModule.js +5 -1
- package/lib/css/CssModulesPlugin.js +13 -0
- package/lib/css/CssParser.js +594 -263
- package/lib/css/syntax.js +875 -462
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +6 -6
- package/lib/dependencies/AMDPlugin.js +2 -2
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +13 -13
- package/lib/dependencies/CommonJsDependencyHelpers.js +39 -0
- package/lib/dependencies/CommonJsExportsDependency.js +47 -2
- package/lib/dependencies/CommonJsExportsParserPlugin.js +10 -10
- package/lib/dependencies/CommonJsImportsParserPlugin.js +18 -18
- package/lib/dependencies/CommonJsPlugin.js +2 -2
- package/lib/dependencies/CommonJsRequireDependency.js +26 -1
- package/lib/dependencies/CommonJsSelfReferenceDependency.js +32 -1
- package/lib/dependencies/ContextDependencyHelpers.js +3 -3
- package/lib/dependencies/CreateRequireParserPlugin.js +6 -6
- package/lib/dependencies/CssIcssExportDependency.js +162 -71
- package/lib/dependencies/CssUrlDependency.js +35 -4
- package/lib/dependencies/ExternalModuleInitFragmentDependency.js +2 -2
- package/lib/dependencies/HarmonyCompatibilityDependency.js +32 -14
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +43 -13
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +7 -19
- package/lib/dependencies/HarmonyImportDependency.js +12 -1
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +11 -11
- package/lib/dependencies/HarmonyModulesPlugin.js +6 -0
- package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +1 -1
- package/lib/dependencies/HtmlEntryDependency.js +797 -172
- package/lib/dependencies/HtmlSourceDependency.js +26 -0
- package/lib/dependencies/ImportDependency.js +43 -1
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +31 -18
- package/lib/dependencies/ImportMetaContextPlugin.js +38 -7
- package/lib/dependencies/ImportMetaGlobDependency.js +81 -0
- package/lib/dependencies/ImportMetaGlobDependencyParserPlugin.js +78 -0
- package/lib/dependencies/ImportMetaGlobHelpers.js +660 -0
- package/lib/dependencies/ImportMetaPlugin.js +532 -180
- package/lib/dependencies/ImportMetaResolveDependency.js +90 -0
- package/lib/dependencies/ImportParserPlugin.js +80 -17
- package/lib/dependencies/ImportPhase.js +10 -8
- package/lib/dependencies/LoaderPlugin.js +5 -1
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +3 -6
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +4 -11
- package/lib/dependencies/SystemPlugin.js +2 -4
- package/lib/dependencies/TopLevelAwaitDependency.js +93 -0
- package/lib/dependencies/URLDependency.js +141 -21
- package/lib/dependencies/{WorkerPlugin.js → WorkerAndWorkletPlugin.js} +324 -112
- package/lib/dependencies/WorkerDependency.js +86 -18
- package/lib/dependencies/WorkletDependency.js +278 -0
- package/lib/dll/DelegatedModuleFactoryPlugin.js +19 -0
- package/lib/errors/EnvironmentNotSupportAsyncWarning.js +1 -1
- package/lib/errors/LoaderLoadingError.js +20 -0
- package/lib/errors/ModuleParseError.js +39 -22
- package/lib/errors/NodeStuffInWebError.js +1 -1
- package/lib/esm/ModuleChunkFormatPlugin.js +47 -14
- package/lib/esm/ModuleChunkLoadingPlugin.js +8 -1
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +29 -1
- package/lib/hmr/lazyCompilationBackend.js +32 -8
- package/lib/html/HtmlGenerator.js +887 -15
- package/lib/html/HtmlModule.js +2 -2
- package/lib/html/HtmlModulesPlugin.js +610 -166
- package/lib/html/HtmlParser.js +603 -247
- package/lib/html/favicon.svg +1 -0
- package/lib/html/syntax.js +1264 -661
- package/lib/ids/IdHelpers.js +1 -1
- package/lib/index.js +6 -0
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +4 -5
- package/lib/javascript/BasicEvaluatedExpression.js +366 -48
- package/lib/javascript/JavascriptGenerator.js +197 -49
- package/lib/javascript/JavascriptModulesPlugin.js +178 -24
- package/lib/javascript/JavascriptParser.js +701 -355
- package/lib/javascript/JavascriptParserHelpers.js +3 -6
- package/lib/javascript/syntax.js +4380 -0
- package/lib/library/ModuleLibraryPlugin.js +38 -1
- package/lib/loaders/LoaderRunner.js +714 -0
- package/lib/loaders/loadLoader.js +100 -0
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +19 -0
- package/lib/node/ReadFileCompileWasmPlugin.js +14 -0
- package/lib/optimize/ConcatenatedModule.js +120 -16
- package/lib/optimize/FlagIncludedChunksPlugin.js +13 -3
- package/lib/optimize/InnerGraphPlugin.js +50 -30
- package/lib/optimize/ModuleConcatenationPlugin.js +69 -3
- package/lib/optimize/SideEffectsFlagPlugin.js +86 -43
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +15 -0
- package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +24 -13
- package/lib/prefetch/ResourceHintPlugin.js +663 -0
- package/lib/prefetch/ResourceHintRuntimeModule.js +149 -0
- package/lib/prefetch/StartupAssetHintRuntimeModule.js +210 -0
- package/lib/prefetch/parseResourceHintOptions.js +103 -0
- package/lib/rules/RuleSetCompiler.js +114 -0
- package/lib/runtime/AsyncModuleGeneratorRuntimeModule.js +56 -0
- package/lib/runtime/AsyncModuleRuntimeModule.js +24 -8
- package/lib/runtime/AutoPublicPathRuntimeModule.js +7 -1
- package/lib/runtime/CommonJsWrapRuntimeModule.js +37 -0
- package/lib/runtime/GetWorkletBootstrapRuntimeModule.js +59 -0
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +204 -8
- package/lib/runtime/SetAnonymousDefaultNameRuntimeModule.js +4 -1
- package/lib/schemes/HttpUriPlugin.js +40 -1
- package/lib/schemes/VirtualUrlPlugin.js +1 -2
- package/lib/serialization/FileMiddleware.js +29 -3
- package/lib/stats/DefaultStatsFactoryPlugin.js +32 -3
- package/lib/stats/DefaultStatsPresetPlugin.js +2 -0
- package/lib/stats/DefaultStatsPrinterPlugin.js +12 -2
- package/lib/stats/StatsFactory.js +15 -8
- package/lib/url/URLParserPlugin.js +66 -13
- package/lib/util/AsyncQueue.js +122 -72
- package/lib/util/SetHelpers.js +1 -1
- package/lib/util/StackedMap.js +122 -48
- package/lib/util/binarySearchBounds.js +2 -2
- package/lib/util/concatenate.js +40 -14
- package/lib/util/createHooksRegistry.js +13 -5
- package/lib/util/dataURL.js +2 -2
- package/lib/util/deterministicGrouping.js +7 -5
- package/lib/util/formatSize.js +6 -2
- package/lib/util/globUtils.js +710 -0
- package/lib/util/identifier.js +23 -6
- package/lib/util/implicitTypeLoaderFallback.js +62 -0
- package/lib/util/internalSerializables.js +88 -71
- package/lib/util/magicComment.js +121 -25
- package/lib/util/numberHash.js +2 -2
- package/lib/wasm-async/AsyncWasmCompileRuntimeModule.js +24 -18
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +33 -22
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +79 -16
- package/lib/web/FetchCompileAsyncWasmPlugin.js +19 -0
- package/lib/web/FetchCompileWasmPlugin.js +14 -0
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +2 -0
- package/lib/webpack.js +65 -0
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +3 -0
- package/module.d.ts +21 -0
- package/package.json +13 -12
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +759 -36
- package/schemas/plugins/HtmlParserOptions.check.js +1 -1
- package/schemas/plugins/ProgressPlugin.check.js +1 -1
- package/schemas/plugins/ProgressPlugin.json +17 -1
- package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
- package/schemas/plugins/container/ContainerReferencePlugin.json +1 -0
- package/schemas/plugins/container/ExternalsType.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.json +1 -0
- package/schemas/plugins/css/CssAutoOrModuleParserOptions.check.js +1 -1
- package/schemas/plugins/css/CssModuleParserOptions.check.js +1 -1
- package/schemas/plugins/css/CssParserOptions.check.js +1 -1
- package/types.d.ts +1213 -96
package/lib/MultiCompiler.js
CHANGED
|
@@ -102,6 +102,8 @@ module.exports = class MultiCompiler {
|
|
|
102
102
|
this.dependencies = new WeakMap();
|
|
103
103
|
/** @type {boolean} */
|
|
104
104
|
this.running = false;
|
|
105
|
+
/** @type {MultiWatching | undefined} */
|
|
106
|
+
this.watching = undefined;
|
|
105
107
|
|
|
106
108
|
/** @type {(Stats | null)[]} */
|
|
107
109
|
const compilerStats = this.compilers.map(() => null);
|
|
@@ -662,10 +664,12 @@ module.exports = class MultiCompiler {
|
|
|
662
664
|
},
|
|
663
665
|
handler
|
|
664
666
|
);
|
|
665
|
-
|
|
667
|
+
this.watching = new MultiWatching(watchings, this);
|
|
668
|
+
return this.watching;
|
|
666
669
|
}
|
|
667
670
|
|
|
668
|
-
|
|
671
|
+
this.watching = new MultiWatching([], this);
|
|
672
|
+
return this.watching;
|
|
669
673
|
}
|
|
670
674
|
|
|
671
675
|
/**
|
|
@@ -709,6 +713,13 @@ module.exports = class MultiCompiler {
|
|
|
709
713
|
* @returns {void}
|
|
710
714
|
*/
|
|
711
715
|
close(callback) {
|
|
716
|
+
if (this.watching) {
|
|
717
|
+
// When there is still an active watching, close this first
|
|
718
|
+
this.watching.close((_err) => {
|
|
719
|
+
this.close(callback);
|
|
720
|
+
});
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
712
723
|
asyncLib.each(
|
|
713
724
|
this.compilers,
|
|
714
725
|
(compiler, callback) => {
|
package/lib/MultiWatching.js
CHANGED
|
@@ -69,6 +69,7 @@ class MultiWatching {
|
|
|
69
69
|
watching.close(finishedCallback);
|
|
70
70
|
},
|
|
71
71
|
(err) => {
|
|
72
|
+
if (this.compiler.watching === this) this.compiler.watching = undefined;
|
|
72
73
|
this.compiler.hooks.watchClose.call();
|
|
73
74
|
if (typeof callback === "function") {
|
|
74
75
|
this.compiler.running = false;
|
package/lib/NodeStuffPlugin.js
CHANGED
|
@@ -34,7 +34,8 @@ const { parseResource } = require("./util/identifier");
|
|
|
34
34
|
const PLUGIN_NAME = "NodeStuffPlugin";
|
|
35
35
|
const URL_MODULE_CONSTANT_FUNCTION_NAME = "__webpack_fileURLToPath__";
|
|
36
36
|
|
|
37
|
-
const { IMPORT_META_DIRNAME, IMPORT_META_FILENAME } =
|
|
37
|
+
const { IMPORT_META_DIRNAME, IMPORT_META_FILENAME, isImportMetaFieldEnabled } =
|
|
38
|
+
ImportMetaPlugin;
|
|
38
39
|
|
|
39
40
|
class NodeStuffPlugin {
|
|
40
41
|
/**
|
|
@@ -97,7 +98,7 @@ class NodeStuffPlugin {
|
|
|
97
98
|
|
|
98
99
|
parser.hooks.expression.for("global").tap(PLUGIN_NAME, (expr) => {
|
|
99
100
|
const dep = getGlobalDep(expr);
|
|
100
|
-
dep.loc =
|
|
101
|
+
dep.loc = parser.getLocation(expr);
|
|
101
102
|
parser.state.module.addPresentationalDependency(dep);
|
|
102
103
|
|
|
103
104
|
if (withWarning) {
|
|
@@ -113,7 +114,7 @@ class NodeStuffPlugin {
|
|
|
113
114
|
|
|
114
115
|
parser.hooks.rename.for("global").tap(PLUGIN_NAME, (expr) => {
|
|
115
116
|
const dep = getGlobalDep(expr);
|
|
116
|
-
dep.loc =
|
|
117
|
+
dep.loc = parser.getLocation(expr);
|
|
117
118
|
parser.state.module.addPresentationalDependency(dep);
|
|
118
119
|
return false;
|
|
119
120
|
});
|
|
@@ -138,7 +139,7 @@ class NodeStuffPlugin {
|
|
|
138
139
|
/** @type {Range} */
|
|
139
140
|
(expr.range)
|
|
140
141
|
);
|
|
141
|
-
dep.loc =
|
|
142
|
+
dep.loc = parser.getLocation(expr);
|
|
142
143
|
parser.state.module.addPresentationalDependency(dep);
|
|
143
144
|
return true;
|
|
144
145
|
});
|
|
@@ -180,7 +181,7 @@ class NodeStuffPlugin {
|
|
|
180
181
|
(expr.range),
|
|
181
182
|
`__webpack_${property}__`
|
|
182
183
|
);
|
|
183
|
-
dep.loc =
|
|
184
|
+
dep.loc = parser.getLocation(expr);
|
|
184
185
|
parser.state.module.addPresentationalDependency(dep);
|
|
185
186
|
|
|
186
187
|
if (warning) {
|
|
@@ -201,7 +202,7 @@ class NodeStuffPlugin {
|
|
|
201
202
|
if (warning) {
|
|
202
203
|
parser.state.module.addWarning(
|
|
203
204
|
new NodeStuffInWebError(
|
|
204
|
-
usingProperty
|
|
205
|
+
parser.getLocation(usingProperty),
|
|
205
206
|
expressionName,
|
|
206
207
|
warning
|
|
207
208
|
)
|
|
@@ -278,7 +279,7 @@ class NodeStuffPlugin {
|
|
|
278
279
|
CachedConstDependency.PLACE_CHUNK
|
|
279
280
|
);
|
|
280
281
|
|
|
281
|
-
dep.loc =
|
|
282
|
+
dep.loc = parser.getLocation(expr);
|
|
282
283
|
parser.state.module.addPresentationalDependency(dep);
|
|
283
284
|
return;
|
|
284
285
|
}
|
|
@@ -297,7 +298,7 @@ class NodeStuffPlugin {
|
|
|
297
298
|
`__webpack_${property}__`,
|
|
298
299
|
ExternalModuleDependency.PLACE_CHUNK
|
|
299
300
|
);
|
|
300
|
-
dep.loc =
|
|
301
|
+
dep.loc = parser.getLocation(expr);
|
|
301
302
|
parser.state.module.addPresentationalDependency(dep);
|
|
302
303
|
|
|
303
304
|
return true;
|
|
@@ -324,9 +325,7 @@ class NodeStuffPlugin {
|
|
|
324
325
|
`__webpack_${property}__`,
|
|
325
326
|
CachedConstDependency.PLACE_CHUNK
|
|
326
327
|
);
|
|
327
|
-
dep.loc =
|
|
328
|
-
usingProperty.loc
|
|
329
|
-
);
|
|
328
|
+
dep.loc = parser.getLocation(usingProperty);
|
|
330
329
|
parser.state.module.addPresentationalDependency(dep);
|
|
331
330
|
return `${property}: __webpack_${property}__,`;
|
|
332
331
|
}
|
|
@@ -346,7 +345,7 @@ class NodeStuffPlugin {
|
|
|
346
345
|
ExternalModuleDependency.PLACE_CHUNK
|
|
347
346
|
);
|
|
348
347
|
|
|
349
|
-
dep.loc =
|
|
348
|
+
dep.loc = parser.getLocation(usingProperty);
|
|
350
349
|
parser.state.module.addPresentationalDependency(dep);
|
|
351
350
|
|
|
352
351
|
return `${property}: __webpack_${property}__,`;
|
|
@@ -359,23 +358,24 @@ class NodeStuffPlugin {
|
|
|
359
358
|
* Dirname and filename handler.
|
|
360
359
|
* @param {JavascriptParser} parser the parser
|
|
361
360
|
* @param {NodeOptions} nodeOptions options
|
|
362
|
-
* @param {{ dirname: "__dirname" | "import.meta.dirname", filename: "__filename" | "import.meta.filename" }} identifiers options
|
|
361
|
+
* @param {{ dirname: "__dirname" | "import.meta.dirname", filename: "__filename" | "import.meta.filename", dirnameEnabled?: boolean, filenameEnabled?: boolean }} identifiers options
|
|
363
362
|
* @returns {void}
|
|
364
363
|
*/
|
|
365
364
|
const dirnameAndFilenameHandler = (
|
|
366
365
|
parser,
|
|
367
366
|
nodeOptions,
|
|
368
|
-
{ dirname, filename }
|
|
367
|
+
{ dirname, filename, dirnameEnabled = true, filenameEnabled = true }
|
|
369
368
|
) => {
|
|
370
|
-
// Keep `import.meta.filename` in code
|
|
369
|
+
// Keep `import.meta.filename` in code.
|
|
371
370
|
if (
|
|
371
|
+
filenameEnabled &&
|
|
372
372
|
nodeOptions.__filename === false &&
|
|
373
373
|
filename === IMPORT_META_FILENAME
|
|
374
374
|
) {
|
|
375
375
|
setModuleConstant(parser, filename, () => filename, "filename");
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
-
if (nodeOptions.__filename) {
|
|
378
|
+
if (filenameEnabled && nodeOptions.__filename) {
|
|
379
379
|
switch (nodeOptions.__filename) {
|
|
380
380
|
case "mock":
|
|
381
381
|
setConstant(parser, filename, "/index.js", "filename");
|
|
@@ -446,15 +446,16 @@ class NodeStuffPlugin {
|
|
|
446
446
|
});
|
|
447
447
|
}
|
|
448
448
|
|
|
449
|
-
// Keep `import.meta.dirname` in code
|
|
449
|
+
// Keep `import.meta.dirname` in code.
|
|
450
450
|
if (
|
|
451
|
+
dirnameEnabled &&
|
|
451
452
|
nodeOptions.__dirname === false &&
|
|
452
453
|
dirname === IMPORT_META_DIRNAME
|
|
453
454
|
) {
|
|
454
455
|
setModuleConstant(parser, dirname, () => dirname, "dirname");
|
|
455
456
|
}
|
|
456
457
|
|
|
457
|
-
if (nodeOptions.__dirname) {
|
|
458
|
+
if (dirnameEnabled && nodeOptions.__dirname) {
|
|
458
459
|
switch (nodeOptions.__dirname) {
|
|
459
460
|
case "mock":
|
|
460
461
|
setConstant(parser, dirname, "/", "dirname");
|
|
@@ -537,19 +538,24 @@ class NodeStuffPlugin {
|
|
|
537
538
|
*/
|
|
538
539
|
const handler = (parser, parserOptions, a, b) => {
|
|
539
540
|
if (b && parserOptions.node === false) {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
541
|
+
if (isImportMetaFieldEnabled(parserOptions.importMeta, "dirname")) {
|
|
542
|
+
setModuleConstant(
|
|
543
|
+
parser,
|
|
544
|
+
IMPORT_META_DIRNAME,
|
|
545
|
+
() => IMPORT_META_DIRNAME,
|
|
546
|
+
"dirname"
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
if (
|
|
550
|
+
isImportMetaFieldEnabled(parserOptions.importMeta, "filename")
|
|
551
|
+
) {
|
|
552
|
+
setModuleConstant(
|
|
553
|
+
parser,
|
|
554
|
+
IMPORT_META_FILENAME,
|
|
555
|
+
() => IMPORT_META_FILENAME,
|
|
556
|
+
"filename"
|
|
557
|
+
);
|
|
558
|
+
}
|
|
553
559
|
return;
|
|
554
560
|
}
|
|
555
561
|
|
|
@@ -570,10 +576,22 @@ class NodeStuffPlugin {
|
|
|
570
576
|
});
|
|
571
577
|
}
|
|
572
578
|
|
|
573
|
-
if (
|
|
579
|
+
if (
|
|
580
|
+
b &&
|
|
581
|
+
(isImportMetaFieldEnabled(parserOptions.importMeta, "dirname") ||
|
|
582
|
+
isImportMetaFieldEnabled(parserOptions.importMeta, "filename"))
|
|
583
|
+
) {
|
|
574
584
|
dirnameAndFilenameHandler(parser, localOptions, {
|
|
575
585
|
dirname: IMPORT_META_DIRNAME,
|
|
576
|
-
filename: IMPORT_META_FILENAME
|
|
586
|
+
filename: IMPORT_META_FILENAME,
|
|
587
|
+
dirnameEnabled: isImportMetaFieldEnabled(
|
|
588
|
+
parserOptions.importMeta,
|
|
589
|
+
"dirname"
|
|
590
|
+
),
|
|
591
|
+
filenameEnabled: isImportMetaFieldEnabled(
|
|
592
|
+
parserOptions.importMeta,
|
|
593
|
+
"filename"
|
|
594
|
+
)
|
|
577
595
|
});
|
|
578
596
|
}
|
|
579
597
|
};
|