webpack 5.85.0 → 5.88.1
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.
Potentially problematic release.
This version of webpack might be problematic. Click here for more details.
- package/README.md +5 -2
- package/lib/APIPlugin.js +150 -99
- package/lib/AsyncDependenciesBlock.js +3 -3
- package/lib/BannerPlugin.js +2 -1
- package/lib/CaseSensitiveModulesWarning.js +3 -1
- package/lib/Chunk.js +35 -17
- package/lib/ChunkGraph.js +4 -4
- package/lib/ChunkGroup.js +20 -9
- package/lib/CompatibilityPlugin.js +50 -30
- package/lib/Compilation.js +2 -1
- package/lib/Compiler.js +10 -9
- package/lib/ConcatenationScope.js +2 -2
- package/lib/ConditionalInitFragment.js +11 -1
- package/lib/ConstPlugin.js +73 -32
- package/lib/ContextModule.js +8 -3
- package/lib/ContextModuleFactory.js +1 -0
- package/lib/ContextReplacementPlugin.js +13 -0
- package/lib/DelegatedModule.js +15 -3
- package/lib/DelegatedModuleFactoryPlugin.js +6 -0
- package/lib/DependenciesBlock.js +1 -1
- package/lib/Dependency.js +11 -5
- package/lib/DependencyTemplates.js +1 -1
- package/lib/DllEntryPlugin.js +11 -1
- package/lib/DllModule.js +6 -0
- package/lib/DllReferencePlugin.js +13 -1
- package/lib/Entrypoint.js +1 -1
- package/lib/ErrorHelpers.js +1 -0
- package/lib/EvalSourceMapDevToolPlugin.js +6 -1
- package/lib/ExportsInfo.js +22 -4
- package/lib/ExportsInfoApiPlugin.js +14 -5
- package/lib/ExternalModule.js +20 -8
- package/lib/FileSystemInfo.js +52 -24
- package/lib/FlagAllModulesAsUsedPlugin.js +6 -1
- package/lib/FlagDependencyUsagePlugin.js +3 -1
- package/lib/FlagEntryExportAsUsedPlugin.js +4 -0
- package/lib/Generator.js +7 -0
- package/lib/HotModuleReplacementPlugin.js +8 -0
- package/lib/InitFragment.js +28 -5
- package/lib/JavascriptMetaInfoPlugin.js +11 -6
- package/lib/LibManifestPlugin.js +20 -4
- package/lib/Module.js +14 -3
- package/lib/ModuleDependencyError.js +4 -2
- package/lib/ModuleDependencyWarning.js +4 -2
- package/lib/ModuleGraph.js +31 -24
- package/lib/ModuleGraphConnection.js +19 -6
- package/lib/ModuleInfoHeaderPlugin.js +9 -2
- package/lib/ModuleNotFoundError.js +5 -2
- package/lib/ModuleProfile.js +1 -0
- package/lib/ModuleRestoreError.js +2 -0
- package/lib/ModuleStoreError.js +2 -1
- package/lib/ModuleTypeConstants.js +7 -0
- package/lib/MultiWatching.js +4 -0
- package/lib/NodeStuffPlugin.js +32 -6
- package/lib/ProgressPlugin.js +71 -15
- package/lib/ProvidePlugin.js +13 -4
- package/lib/RawModule.js +3 -1
- package/lib/RequireJsStuffPlugin.js +7 -0
- package/lib/RuntimeGlobals.js +5 -0
- package/lib/RuntimeModule.js +3 -3
- package/lib/RuntimePlugin.js +6 -3
- package/lib/RuntimeTemplate.js +22 -4
- package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -0
- package/lib/SourceMapDevToolPlugin.js +7 -2
- package/lib/UseStrictPlugin.js +10 -3
- package/lib/Watching.js +62 -25
- package/lib/WebpackError.js +6 -5
- package/lib/WebpackIsIncludedPlugin.js +6 -4
- package/lib/WebpackOptionsApply.js +4 -2
- package/lib/WebpackOptionsDefaulter.js +10 -3
- package/lib/asset/AssetGenerator.js +2 -1
- package/lib/asset/AssetParser.js +11 -6
- package/lib/asset/AssetSourceParser.js +8 -3
- package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -0
- package/lib/buildChunkGraph.js +37 -21
- package/lib/cache/IdleFileCachePlugin.js +2 -1
- package/lib/cache/PackFileCacheStrategy.js +53 -22
- package/lib/config/browserslistTargetHandler.js +7 -7
- package/lib/config/defaults.js +43 -26
- package/lib/container/RemoteRuntimeModule.js +1 -1
- package/lib/css/CssExportsGenerator.js +9 -0
- package/lib/css/CssGenerator.js +1 -1
- package/lib/css/CssLoadingRuntimeModule.js +43 -19
- package/lib/css/CssModulesPlugin.js +42 -14
- package/lib/css/CssParser.js +22 -0
- package/lib/dependencies/AMDDefineDependency.js +34 -4
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +5 -0
- package/lib/dependencies/AMDRuntimeModules.js +2 -2
- package/lib/dependencies/CommonJsExportsParserPlugin.js +14 -4
- package/lib/dependencies/CommonJsImportsParserPlugin.js +169 -59
- package/lib/dependencies/CommonJsPlugin.js +13 -8
- package/lib/dependencies/CommonJsRequireContextDependency.js +2 -2
- package/lib/dependencies/ConstDependency.js +2 -2
- package/lib/dependencies/ContextDependency.js +7 -2
- package/lib/dependencies/CssImportDependency.js +1 -1
- package/lib/dependencies/CssLocalIdentifierDependency.js +5 -0
- package/lib/dependencies/CssUrlDependency.js +3 -3
- package/lib/dependencies/DllEntryDependency.js +5 -0
- package/lib/dependencies/DynamicExports.js +10 -6
- package/lib/dependencies/ExportsInfoDependency.js +14 -4
- package/lib/dependencies/HarmonyCompatibilityDependency.js +2 -1
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +3 -1
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +12 -5
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +2 -0
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +4 -4
- package/lib/dependencies/HarmonyExports.js +9 -5
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +40 -27
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +1 -2
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +31 -21
- package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +15 -3
- package/lib/dependencies/ImportDependency.js +5 -3
- package/lib/dependencies/ImportEagerDependency.js +5 -3
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +19 -0
- package/lib/dependencies/ImportMetaPlugin.js +31 -15
- package/lib/dependencies/ImportParserPlugin.js +62 -25
- package/lib/dependencies/ImportWeakDependency.js +5 -3
- package/lib/dependencies/JsonExportsDependency.js +1 -1
- package/lib/dependencies/ModuleDependency.js +1 -1
- package/lib/dependencies/ModuleDependencyTemplateAsId.js +2 -1
- package/lib/dependencies/ProvidedDependency.js +4 -1
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +13 -5
- package/lib/dependencies/RequireEnsureDependenciesBlock.js +5 -2
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +6 -1
- package/lib/dependencies/RequireHeaderDependency.js +4 -0
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +26 -5
- package/lib/dependencies/RequireResolveHeaderDependency.js +9 -0
- package/lib/dependencies/SystemPlugin.js +17 -5
- package/lib/dependencies/SystemRuntimeModule.js +1 -1
- package/lib/dependencies/URLDependency.js +2 -2
- package/lib/dependencies/URLPlugin.js +9 -4
- package/lib/dependencies/WebAssemblyImportDependency.js +1 -1
- package/lib/dependencies/WorkerPlugin.js +59 -22
- package/lib/esm/ExportWebpackRequireRuntimeModule.js +1 -1
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +1 -1
- package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -1
- package/lib/ids/HashedModuleIdsPlugin.js +1 -1
- package/lib/ids/SyncModuleIdsPlugin.js +1 -0
- package/lib/javascript/BasicEvaluatedExpression.js +28 -19
- package/lib/javascript/CommonJsChunkFormatPlugin.js +6 -2
- package/lib/javascript/JavascriptModulesPlugin.js +25 -5
- package/lib/javascript/JavascriptParser.js +157 -85
- package/lib/javascript/JavascriptParserHelpers.js +37 -15
- package/lib/json/JsonData.js +2 -2
- package/lib/json/JsonParser.js +25 -12
- package/lib/library/AmdLibraryPlugin.js +2 -2
- package/lib/library/AssignLibraryPlugin.js +13 -1
- package/lib/library/EnableLibraryPlugin.js +4 -0
- package/lib/library/SystemLibraryPlugin.js +1 -1
- package/lib/library/UmdLibraryPlugin.js +20 -2
- package/lib/logging/runtime.js +1 -1
- package/lib/logging/truncateArgs.js +4 -0
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +10 -6
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +2 -1
- package/lib/node/RequireChunkLoadingRuntimeModule.js +10 -6
- package/lib/optimize/AggressiveMergingPlugin.js +8 -0
- package/lib/optimize/AggressiveSplittingPlugin.js +9 -2
- package/lib/optimize/EnsureChunkConditionsPlugin.js +3 -0
- package/lib/optimize/FlagIncludedChunksPlugin.js +11 -5
- package/lib/optimize/InnerGraph.js +5 -5
- package/lib/optimize/InnerGraphPlugin.js +2 -1
- package/lib/optimize/LimitChunkCountPlugin.js +29 -4
- package/lib/optimize/MangleExportsPlugin.js +1 -1
- package/lib/optimize/MinMaxSizeWarning.js +5 -0
- package/lib/optimize/ModuleConcatenationPlugin.js +59 -2
- package/lib/optimize/RealContentHashPlugin.js +80 -30
- package/lib/optimize/RemoveParentModulesPlugin.js +6 -0
- package/lib/optimize/RuntimeChunkPlugin.js +9 -1
- package/lib/optimize/SideEffectsFlagPlugin.js +10 -1
- package/lib/optimize/SplitChunksPlugin.js +71 -31
- package/lib/performance/SizeLimitsPlugin.js +7 -4
- package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +4 -2
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +3 -1
- package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +6 -3
- package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +4 -2
- package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +4 -2
- package/lib/rules/BasicEffectRulePlugin.js +4 -0
- package/lib/rules/BasicMatcherRulePlugin.js +5 -0
- package/lib/rules/RuleSetCompiler.js +3 -3
- package/lib/rules/UseEffectRulePlugin.js +6 -4
- package/lib/runtime/AsyncModuleRuntimeModule.js +8 -5
- package/lib/runtime/AutoPublicPathRuntimeModule.js +4 -2
- package/lib/runtime/BaseUriRuntimeModule.js +3 -3
- package/lib/runtime/ChunkNameRuntimeModule.js +1 -1
- package/lib/runtime/CompatGetDefaultExportRuntimeModule.js +5 -2
- package/lib/runtime/CompatRuntimeModule.js +7 -2
- package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +5 -2
- package/lib/runtime/CreateScriptRuntimeModule.js +4 -2
- package/lib/runtime/CreateScriptUrlRuntimeModule.js +4 -2
- package/lib/runtime/DefinePropertyGettersRuntimeModule.js +5 -2
- package/lib/runtime/EnsureChunkRuntimeModule.js +15 -4
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +6 -10
- package/lib/runtime/GetFullHashRuntimeModule.js +4 -3
- package/lib/runtime/GetMainFilenameRuntimeModule.js +5 -2
- package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +4 -2
- package/lib/runtime/GlobalRuntimeModule.js +1 -1
- package/lib/runtime/HasOwnPropertyRuntimeModule.js +5 -2
- package/lib/runtime/LoadScriptRuntimeModule.js +64 -48
- package/lib/runtime/MakeNamespaceObjectRuntimeModule.js +5 -2
- package/lib/runtime/NonceRuntimeModule.js +1 -1
- package/lib/runtime/OnChunksLoadedRuntimeModule.js +4 -2
- package/lib/runtime/PublicPathRuntimeModule.js +4 -2
- package/lib/runtime/RelativeUrlRuntimeModule.js +5 -2
- package/lib/runtime/RuntimeIdRuntimeModule.js +6 -2
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +9 -3
- package/lib/runtime/StartupEntrypointRuntimeModule.js +3 -2
- package/lib/runtime/SystemContextRuntimeModule.js +1 -1
- package/lib/serialization/BinaryMiddleware.js +143 -1
- package/lib/serialization/ErrorObjectSerializer.js +3 -0
- package/lib/serialization/ObjectMiddleware.js +9 -3
- package/lib/serialization/types.js +1 -1
- package/lib/sharing/ConsumeSharedFallbackDependency.js +3 -0
- package/lib/sharing/ConsumeSharedRuntimeModule.js +14 -5
- package/lib/sharing/ProvideSharedDependency.js +11 -0
- package/lib/sharing/ProvideSharedModule.js +4 -0
- package/lib/sharing/ProvideSharedPlugin.js +22 -21
- package/lib/sharing/ShareRuntimeModule.js +12 -5
- package/lib/sharing/resolveMatchedConfigs.js +1 -1
- package/lib/sharing/utils.js +32 -5
- package/lib/util/AsyncQueue.js +4 -2
- package/lib/util/ParallelismFactorCalculator.js +10 -0
- package/lib/util/Semaphore.js +1 -1
- package/lib/util/StackedCacheMap.js +1 -1
- package/lib/util/URLAbsoluteSpecifier.js +1 -1
- package/lib/util/createHash.js +30 -9
- package/lib/util/deprecation.js +10 -3
- package/lib/util/deterministicGrouping.js +50 -11
- package/lib/util/findGraphRoots.js +4 -2
- package/lib/util/memoize.js +3 -3
- package/lib/util/processAsyncTree.js +7 -1
- package/lib/util/registerExternalSerializer.js +1 -1
- package/lib/util/runtime.js +84 -21
- package/lib/util/semver.js +1 -0
- package/lib/util/smartGrouping.js +1 -1
- package/lib/validateSchema.js +6 -2
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +6 -2
- package/lib/wasm-async/AsyncWebAssemblyParser.js +7 -3
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +14 -7
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +3 -1
- package/lib/wasm-sync/WebAssemblyGenerator.js +1 -0
- package/lib/wasm-sync/WebAssemblyParser.js +6 -2
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +14 -4
- package/lib/webpack.js +11 -2
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +15 -16
- package/module.d.ts +1 -0
- package/package.json +5 -4
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +52 -6
- package/schemas/plugins/css/CssGeneratorOptions.json +1 -1
- package/schemas/plugins/css/CssParserOptions.json +1 -1
- package/types.d.ts +606 -292
@@ -9,20 +9,26 @@ const UnsupportedFeatureWarning = require("../UnsupportedFeatureWarning");
|
|
9
9
|
const ConstDependency = require("../dependencies/ConstDependency");
|
10
10
|
const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
11
11
|
|
12
|
-
/** @typedef {import("estree").Expression}
|
12
|
+
/** @typedef {import("estree").Expression} Expression */
|
13
13
|
/** @typedef {import("estree").Node} Node */
|
14
|
+
/** @typedef {import("estree").SourceLocation} SourceLocation */
|
14
15
|
/** @typedef {import("./JavascriptParser")} JavascriptParser */
|
16
|
+
/** @typedef {import("./JavascriptParser").Range} Range */
|
15
17
|
|
16
18
|
/**
|
17
19
|
* @param {JavascriptParser} parser the parser
|
18
20
|
* @param {string} value the const value
|
19
21
|
* @param {string[]=} runtimeRequirements runtime requirements
|
20
|
-
* @returns {function(
|
22
|
+
* @returns {function(Expression): true} plugin function
|
21
23
|
*/
|
22
24
|
exports.toConstantDependency = (parser, value, runtimeRequirements) => {
|
23
25
|
return function constDependency(expr) {
|
24
|
-
const dep = new ConstDependency(
|
25
|
-
|
26
|
+
const dep = new ConstDependency(
|
27
|
+
value,
|
28
|
+
/** @type {Range} */ (expr.range),
|
29
|
+
runtimeRequirements
|
30
|
+
);
|
31
|
+
dep.loc = /** @type {SourceLocation} */ (expr.loc);
|
26
32
|
parser.state.module.addPresentationalDependency(dep);
|
27
33
|
return true;
|
28
34
|
};
|
@@ -30,33 +36,37 @@ exports.toConstantDependency = (parser, value, runtimeRequirements) => {
|
|
30
36
|
|
31
37
|
/**
|
32
38
|
* @param {string} value the string value
|
33
|
-
* @returns {function(
|
39
|
+
* @returns {function(Expression): BasicEvaluatedExpression} plugin function
|
34
40
|
*/
|
35
41
|
exports.evaluateToString = value => {
|
36
42
|
return function stringExpression(expr) {
|
37
|
-
return new BasicEvaluatedExpression()
|
43
|
+
return new BasicEvaluatedExpression()
|
44
|
+
.setString(value)
|
45
|
+
.setRange(/** @type {Range} */ (expr.range));
|
38
46
|
};
|
39
47
|
};
|
40
48
|
|
41
49
|
/**
|
42
50
|
* @param {number} value the number value
|
43
|
-
* @returns {function(
|
51
|
+
* @returns {function(Expression): BasicEvaluatedExpression} plugin function
|
44
52
|
*/
|
45
53
|
exports.evaluateToNumber = value => {
|
46
54
|
return function stringExpression(expr) {
|
47
|
-
return new BasicEvaluatedExpression()
|
55
|
+
return new BasicEvaluatedExpression()
|
56
|
+
.setNumber(value)
|
57
|
+
.setRange(/** @type {Range} */ (expr.range));
|
48
58
|
};
|
49
59
|
};
|
50
60
|
|
51
61
|
/**
|
52
62
|
* @param {boolean} value the boolean value
|
53
|
-
* @returns {function(
|
63
|
+
* @returns {function(Expression): BasicEvaluatedExpression} plugin function
|
54
64
|
*/
|
55
65
|
exports.evaluateToBoolean = value => {
|
56
66
|
return function booleanExpression(expr) {
|
57
67
|
return new BasicEvaluatedExpression()
|
58
68
|
.setBoolean(value)
|
59
|
-
.setRange(expr.range);
|
69
|
+
.setRange(/** @type {Range} */ (expr.range));
|
60
70
|
};
|
61
71
|
};
|
62
72
|
|
@@ -65,14 +75,14 @@ exports.evaluateToBoolean = value => {
|
|
65
75
|
* @param {string} rootInfo rootInfo
|
66
76
|
* @param {function(): string[]} getMembers getMembers
|
67
77
|
* @param {boolean|null=} truthy is truthy, null if nullish
|
68
|
-
* @returns {function(
|
78
|
+
* @returns {function(Expression): BasicEvaluatedExpression} callback
|
69
79
|
*/
|
70
80
|
exports.evaluateToIdentifier = (identifier, rootInfo, getMembers, truthy) => {
|
71
81
|
return function identifierExpression(expr) {
|
72
82
|
let evaluatedExpression = new BasicEvaluatedExpression()
|
73
83
|
.setIdentifier(identifier, rootInfo, getMembers)
|
74
84
|
.setSideEffects(false)
|
75
|
-
.setRange(expr.range);
|
85
|
+
.setRange(/** @type {Range} */ (expr.range));
|
76
86
|
switch (truthy) {
|
77
87
|
case true:
|
78
88
|
evaluatedExpression.setTruthy();
|
@@ -89,14 +99,26 @@ exports.evaluateToIdentifier = (identifier, rootInfo, getMembers, truthy) => {
|
|
89
99
|
};
|
90
100
|
};
|
91
101
|
|
102
|
+
/**
|
103
|
+
* @param {JavascriptParser} parser the parser
|
104
|
+
* @param {string} message the message
|
105
|
+
* @returns {function(Expression): boolean | undefined} callback to handle unsupported expression
|
106
|
+
*/
|
92
107
|
exports.expressionIsUnsupported = (parser, message) => {
|
93
108
|
return function unsupportedExpression(expr) {
|
94
|
-
const dep = new ConstDependency(
|
95
|
-
|
109
|
+
const dep = new ConstDependency(
|
110
|
+
"(void 0)",
|
111
|
+
/** @type {Range} */ (expr.range),
|
112
|
+
null
|
113
|
+
);
|
114
|
+
dep.loc = /** @type {SourceLocation} */ (expr.loc);
|
96
115
|
parser.state.module.addPresentationalDependency(dep);
|
97
116
|
if (!parser.state.module) return;
|
98
117
|
parser.state.module.addWarning(
|
99
|
-
new UnsupportedFeatureWarning(
|
118
|
+
new UnsupportedFeatureWarning(
|
119
|
+
message,
|
120
|
+
/** @type {SourceLocation} */ (expr.loc)
|
121
|
+
)
|
100
122
|
);
|
101
123
|
return true;
|
102
124
|
};
|
package/lib/json/JsonData.js
CHANGED
@@ -40,14 +40,14 @@ class JsonData {
|
|
40
40
|
|
41
41
|
/**
|
42
42
|
* @param {Hash} hash hash to be updated
|
43
|
-
* @returns {
|
43
|
+
* @returns {void} the updated hash
|
44
44
|
*/
|
45
45
|
updateHash(hash) {
|
46
46
|
if (this._buffer === undefined && this._data !== undefined) {
|
47
47
|
this._buffer = Buffer.from(JSON.stringify(this._data));
|
48
48
|
}
|
49
49
|
|
50
|
-
if (this._buffer)
|
50
|
+
if (this._buffer) hash.update(this._buffer);
|
51
51
|
}
|
52
52
|
}
|
53
53
|
|
package/lib/json/JsonParser.js
CHANGED
@@ -5,16 +5,20 @@
|
|
5
5
|
|
6
6
|
"use strict";
|
7
7
|
|
8
|
-
const parseJson = require("json-parse-even-better-errors");
|
9
8
|
const Parser = require("../Parser");
|
10
9
|
const JsonExportsDependency = require("../dependencies/JsonExportsDependency");
|
10
|
+
const memoize = require("../util/memoize");
|
11
11
|
const JsonData = require("./JsonData");
|
12
12
|
|
13
13
|
/** @typedef {import("../../declarations/plugins/JsonModulesPluginParser").JsonModulesPluginParserOptions} JsonModulesPluginParserOptions */
|
14
|
+
/** @typedef {import("../Module").BuildInfo} BuildInfo */
|
15
|
+
/** @typedef {import("../Module").BuildMeta} BuildMeta */
|
14
16
|
/** @typedef {import("../Parser").ParserState} ParserState */
|
15
17
|
/** @typedef {import("../Parser").PreparsedAst} PreparsedAst */
|
16
18
|
/** @typedef {import("./JsonModulesPlugin").RawJsonData} RawJsonData */
|
17
19
|
|
20
|
+
const getParseJson = memoize(() => require("json-parse-even-better-errors"));
|
21
|
+
|
18
22
|
class JsonParser extends Parser {
|
19
23
|
/**
|
20
24
|
* @param {JsonModulesPluginParserOptions} options parser options
|
@@ -36,17 +40,26 @@ class JsonParser extends Parser {
|
|
36
40
|
|
37
41
|
/** @type {NonNullable<JsonModulesPluginParserOptions["parse"]>} */
|
38
42
|
const parseFn =
|
39
|
-
typeof this.options.parse === "function"
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
typeof this.options.parse === "function"
|
44
|
+
? this.options.parse
|
45
|
+
: getParseJson();
|
46
|
+
/** @type {Buffer | RawJsonData | undefined} */
|
47
|
+
let data;
|
48
|
+
try {
|
49
|
+
data =
|
50
|
+
typeof source === "object"
|
51
|
+
? source
|
52
|
+
: parseFn(source[0] === "\ufeff" ? source.slice(1) : source);
|
53
|
+
} catch (e) {
|
54
|
+
throw new Error(`Cannot parse JSON: ${/** @type {Error} */ (e).message}`);
|
55
|
+
}
|
56
|
+
const jsonData = new JsonData(/** @type {Buffer | RawJsonData} */ (data));
|
57
|
+
const buildInfo = /** @type {BuildInfo} */ (state.module.buildInfo);
|
58
|
+
buildInfo.jsonData = jsonData;
|
59
|
+
buildInfo.strict = true;
|
60
|
+
const buildMeta = /** @type {BuildMeta} */ (state.module.buildMeta);
|
61
|
+
buildMeta.exportsType = "default";
|
62
|
+
buildMeta.defaultObject =
|
50
63
|
typeof data === "object" ? "redirect-warn" : false;
|
51
64
|
state.module.addDependency(new JsonExportsDependency(jsonData));
|
52
65
|
return state;
|
@@ -68,8 +68,8 @@ class AmdLibraryPlugin extends AbstractLibraryPlugin {
|
|
68
68
|
}
|
69
69
|
}
|
70
70
|
return {
|
71
|
-
name: /** @type {string
|
72
|
-
amdContainer: /** @type {string
|
71
|
+
name: /** @type {string} */ (name),
|
72
|
+
amdContainer: /** @type {string} */ (amdContainer)
|
73
73
|
};
|
74
74
|
}
|
75
75
|
|
@@ -17,6 +17,7 @@ const AbstractLibraryPlugin = require("./AbstractLibraryPlugin");
|
|
17
17
|
/** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */
|
18
18
|
/** @typedef {import("../../declarations/WebpackOptions").LibraryType} LibraryType */
|
19
19
|
/** @typedef {import("../Chunk")} Chunk */
|
20
|
+
/** @typedef {import("../Compilation")} Compilation */
|
20
21
|
/** @typedef {import("../Compilation").ChunkHashContext} ChunkHashContext */
|
21
22
|
/** @typedef {import("../Compiler")} Compiler */
|
22
23
|
/** @typedef {import("../Module")} Module */
|
@@ -59,6 +60,7 @@ const accessWithInit = (accessor, existingLength, initLast = false) => {
|
|
59
60
|
let i = 1;
|
60
61
|
|
61
62
|
// all properties printed so far (excluding base)
|
63
|
+
/** @type {string[] | undefined} */
|
62
64
|
let propsSoFar;
|
63
65
|
|
64
66
|
// if there is existingLength, print all properties until this position as property access
|
@@ -142,7 +144,7 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin {
|
|
142
144
|
}
|
143
145
|
}
|
144
146
|
return {
|
145
|
-
name: /** @type {string|string[]
|
147
|
+
name: /** @type {string | string[]} */ (name),
|
146
148
|
export: library.export
|
147
149
|
};
|
148
150
|
}
|
@@ -173,12 +175,22 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin {
|
|
173
175
|
moduleGraph.addExtraReason(module, "used as library export");
|
174
176
|
}
|
175
177
|
|
178
|
+
/**
|
179
|
+
* @param {Compilation} compilation the compilation
|
180
|
+
* @returns {string[]} the prefix
|
181
|
+
*/
|
176
182
|
_getPrefix(compilation) {
|
177
183
|
return this.prefix === "global"
|
178
184
|
? [compilation.runtimeTemplate.globalObject]
|
179
185
|
: this.prefix;
|
180
186
|
}
|
181
187
|
|
188
|
+
/**
|
189
|
+
* @param {AssignLibraryPluginParsed} options the library options
|
190
|
+
* @param {Chunk} chunk the chunk
|
191
|
+
* @param {Compilation} compilation the compilation
|
192
|
+
* @returns {Array<string>} the resolved full name
|
193
|
+
*/
|
182
194
|
_getResolvedFullName(options, chunk, compilation) {
|
183
195
|
const prefix = this._getPrefix(compilation);
|
184
196
|
const fullName = options.name ? prefix.concat(options.name) : prefix;
|
@@ -12,6 +12,10 @@
|
|
12
12
|
/** @type {WeakMap<Compiler, Set<LibraryType>>} */
|
13
13
|
const enabledTypes = new WeakMap();
|
14
14
|
|
15
|
+
/**
|
16
|
+
* @param {Compiler} compiler the compiler instance
|
17
|
+
* @returns {Set<LibraryType>} enabled types
|
18
|
+
*/
|
15
19
|
const getEnabledTypes = compiler => {
|
16
20
|
let set = enabledTypes.get(compiler);
|
17
21
|
if (set === undefined) {
|
@@ -148,6 +148,10 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin {
|
|
148
148
|
requiredExternals = externals;
|
149
149
|
}
|
150
150
|
|
151
|
+
/**
|
152
|
+
* @param {string} str the string to replace
|
153
|
+
* @returns {string} the replaced keys
|
154
|
+
*/
|
151
155
|
const replaceKeys = str => {
|
152
156
|
return compilation.getPath(str, {
|
153
157
|
chunk
|
@@ -178,6 +182,10 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin {
|
|
178
182
|
);
|
179
183
|
};
|
180
184
|
|
185
|
+
/**
|
186
|
+
* @param {string} type the type
|
187
|
+
* @returns {string} external require array
|
188
|
+
*/
|
181
189
|
const externalsRequireArray = type => {
|
182
190
|
return replaceKeys(
|
183
191
|
externals
|
@@ -185,7 +193,9 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin {
|
|
185
193
|
let expr;
|
186
194
|
let request = m.request;
|
187
195
|
if (typeof request === "object") {
|
188
|
-
request =
|
196
|
+
request =
|
197
|
+
/** @type {Record<string, string | string[]>} */
|
198
|
+
(request)[type];
|
189
199
|
}
|
190
200
|
if (request === undefined) {
|
191
201
|
throw new Error(
|
@@ -246,6 +256,10 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin {
|
|
246
256
|
|
247
257
|
const { auxiliaryComment, namedDefine, names } = options;
|
248
258
|
|
259
|
+
/**
|
260
|
+
* @param {keyof LibraryCustomUmdCommentObject} type type
|
261
|
+
* @returns {string} comment
|
262
|
+
*/
|
249
263
|
const getAuxiliaryComment = type => {
|
250
264
|
if (auxiliaryComment) {
|
251
265
|
if (typeof auxiliaryComment === "string")
|
@@ -299,7 +313,11 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin {
|
|
299
313
|
" else\n" +
|
300
314
|
" " +
|
301
315
|
replaceKeys(
|
302
|
-
accessorAccess(
|
316
|
+
accessorAccess(
|
317
|
+
"root",
|
318
|
+
/** @type {string | string[]} */ (names.root) ||
|
319
|
+
/** @type {string} */ (names.commonjs)
|
320
|
+
)
|
303
321
|
) +
|
304
322
|
" = factory(" +
|
305
323
|
externalsRootArray(externals) +
|
package/lib/logging/runtime.js
CHANGED
@@ -16,6 +16,8 @@ const compileBooleanMatcher = require("../util/compileBooleanMatcher");
|
|
16
16
|
const { getUndoPath } = require("../util/identifier");
|
17
17
|
|
18
18
|
/** @typedef {import("../Chunk")} Chunk */
|
19
|
+
/** @typedef {import("../ChunkGraph")} ChunkGraph */
|
20
|
+
/** @typedef {import("../Compilation")} Compilation */
|
19
21
|
|
20
22
|
class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
|
21
23
|
/**
|
@@ -46,11 +48,13 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
|
|
46
48
|
}
|
47
49
|
|
48
50
|
/**
|
49
|
-
* @returns {string} runtime code
|
51
|
+
* @returns {string | null} runtime code
|
50
52
|
*/
|
51
53
|
generate() {
|
52
|
-
const
|
53
|
-
const
|
54
|
+
const compilation = /** @type {Compilation} */ (this.compilation);
|
55
|
+
const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph);
|
56
|
+
const chunk = /** @type {Chunk} */ (this.chunk);
|
57
|
+
const { runtimeTemplate } = compilation;
|
54
58
|
const fn = RuntimeGlobals.ensureChunkHandlers;
|
55
59
|
const withBaseURI = this.runtimeRequirements.has(RuntimeGlobals.baseURI);
|
56
60
|
const withExternalInstallChunk = this.runtimeRequirements.has(
|
@@ -72,8 +76,8 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
|
|
72
76
|
const hasJsMatcher = compileBooleanMatcher(conditionMap);
|
73
77
|
const initialChunkIds = getInitialChunkIds(chunk, chunkGraph, chunkHasJs);
|
74
78
|
|
75
|
-
const outputName =
|
76
|
-
getChunkFilenameTemplate(chunk,
|
79
|
+
const outputName = compilation.getPath(
|
80
|
+
getChunkFilenameTemplate(chunk, compilation.outputOptions),
|
77
81
|
{
|
78
82
|
chunk,
|
79
83
|
contentHashType: "javascript"
|
@@ -81,7 +85,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
|
|
81
85
|
);
|
82
86
|
const rootOutputDir = getUndoPath(
|
83
87
|
outputName,
|
84
|
-
/** @type {string} */ (
|
88
|
+
/** @type {string} */ (compilation.outputOptions.path),
|
85
89
|
false
|
86
90
|
);
|
87
91
|
|
@@ -40,6 +40,7 @@ class ReadFileCompileAsyncWasmPlugin {
|
|
40
40
|
: globalWasmLoading;
|
41
41
|
return wasmLoading === this._type;
|
42
42
|
};
|
43
|
+
const { importMetaName } = compilation.outputOptions;
|
43
44
|
/**
|
44
45
|
* @type {(path: string) => string}
|
45
46
|
*/
|
@@ -48,7 +49,7 @@ class ReadFileCompileAsyncWasmPlugin {
|
|
48
49
|
Template.asString([
|
49
50
|
"Promise.all([import('fs'), import('url')]).then(([{ readFile }, { URL }]) => new Promise((resolve, reject) => {",
|
50
51
|
Template.indent([
|
51
|
-
`readFile(new URL(${path},
|
52
|
+
`readFile(new URL(${path}, ${importMetaName}.url), (err, buffer) => {`,
|
52
53
|
Template.indent([
|
53
54
|
"if (err) return reject(err);",
|
54
55
|
"",
|
@@ -16,6 +16,8 @@ const compileBooleanMatcher = require("../util/compileBooleanMatcher");
|
|
16
16
|
const { getUndoPath } = require("../util/identifier");
|
17
17
|
|
18
18
|
/** @typedef {import("../Chunk")} Chunk */
|
19
|
+
/** @typedef {import("../ChunkGraph")} ChunkGraph */
|
20
|
+
/** @typedef {import("../Compilation")} Compilation */
|
19
21
|
|
20
22
|
class RequireChunkLoadingRuntimeModule extends RuntimeModule {
|
21
23
|
/**
|
@@ -46,11 +48,13 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule {
|
|
46
48
|
}
|
47
49
|
|
48
50
|
/**
|
49
|
-
* @returns {string} runtime code
|
51
|
+
* @returns {string | null} runtime code
|
50
52
|
*/
|
51
53
|
generate() {
|
52
|
-
const
|
53
|
-
const
|
54
|
+
const compilation = /** @type {Compilation} */ (this.compilation);
|
55
|
+
const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph);
|
56
|
+
const chunk = /** @type {Chunk} */ (this.chunk);
|
57
|
+
const { runtimeTemplate } = compilation;
|
54
58
|
const fn = RuntimeGlobals.ensureChunkHandlers;
|
55
59
|
const withBaseURI = this.runtimeRequirements.has(RuntimeGlobals.baseURI);
|
56
60
|
const withExternalInstallChunk = this.runtimeRequirements.has(
|
@@ -72,8 +76,8 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule {
|
|
72
76
|
const hasJsMatcher = compileBooleanMatcher(conditionMap);
|
73
77
|
const initialChunkIds = getInitialChunkIds(chunk, chunkGraph, chunkHasJs);
|
74
78
|
|
75
|
-
const outputName =
|
76
|
-
getChunkFilenameTemplate(chunk,
|
79
|
+
const outputName = compilation.getPath(
|
80
|
+
getChunkFilenameTemplate(chunk, compilation.outputOptions),
|
77
81
|
{
|
78
82
|
chunk,
|
79
83
|
contentHashType: "javascript"
|
@@ -81,7 +85,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule {
|
|
81
85
|
);
|
82
86
|
const rootOutputDir = getUndoPath(
|
83
87
|
outputName,
|
84
|
-
/** @type {string} */ (
|
88
|
+
/** @type {string} */ (compilation.outputOptions.path),
|
85
89
|
true
|
86
90
|
);
|
87
91
|
|
@@ -10,7 +10,15 @@ const { STAGE_ADVANCED } = require("../OptimizationStages");
|
|
10
10
|
/** @typedef {import("../Chunk")} Chunk */
|
11
11
|
/** @typedef {import("../Compiler")} Compiler */
|
12
12
|
|
13
|
+
/**
|
14
|
+
* @typedef {Object} AggressiveMergingPluginOptions
|
15
|
+
* @property {number=} minSizeReduce minimal size reduction to trigger merging
|
16
|
+
*/
|
17
|
+
|
13
18
|
class AggressiveMergingPlugin {
|
19
|
+
/**
|
20
|
+
* @param {AggressiveMergingPluginOptions=} [options] options object
|
21
|
+
*/
|
14
22
|
constructor(options) {
|
15
23
|
if (
|
16
24
|
(options !== undefined && typeof options !== "object") ||
|
@@ -30,6 +30,12 @@ const validate = createSchemaValidation(
|
|
30
30
|
}
|
31
31
|
);
|
32
32
|
|
33
|
+
/**
|
34
|
+
* @param {ChunkGraph} chunkGraph the chunk graph
|
35
|
+
* @param {Chunk} oldChunk the old chunk
|
36
|
+
* @param {Chunk} newChunk the new chunk
|
37
|
+
* @returns {(module: Module) => void} function to move module between chunks
|
38
|
+
*/
|
33
39
|
const moveModuleBetween = (chunkGraph, oldChunk, newChunk) => {
|
34
40
|
return module => {
|
35
41
|
chunkGraph.disconnectChunkAndModule(oldChunk, module);
|
@@ -92,6 +98,7 @@ class AggressiveSplittingPlugin {
|
|
92
98
|
compilation => {
|
93
99
|
let needAdditionalSeal = false;
|
94
100
|
let newSplits;
|
101
|
+
/** @type {Set<Chunk>} */
|
95
102
|
let fromAggressiveSplittingSet;
|
96
103
|
let chunkSplitDataMap;
|
97
104
|
compilation.hooks.optimize.tap("AggressiveSplittingPlugin", () => {
|
@@ -133,8 +140,8 @@ class AggressiveSplittingPlugin {
|
|
133
140
|
? recordedSplits.concat(newSplits)
|
134
141
|
: recordedSplits;
|
135
142
|
|
136
|
-
const minSize = this.options.minSize;
|
137
|
-
const maxSize = this.options.maxSize;
|
143
|
+
const minSize = /** @type {number} */ (this.options.minSize);
|
144
|
+
const maxSize = /** @type {number} */ (this.options.maxSize);
|
138
145
|
|
139
146
|
const applySplit = splitData => {
|
140
147
|
// Cannot split if id is already taken
|
@@ -21,6 +21,9 @@ class EnsureChunkConditionsPlugin {
|
|
21
21
|
compiler.hooks.compilation.tap(
|
22
22
|
"EnsureChunkConditionsPlugin",
|
23
23
|
compilation => {
|
24
|
+
/**
|
25
|
+
* @param {Iterable<Chunk>} chunks the chunks
|
26
|
+
*/
|
24
27
|
const handler = chunks => {
|
25
28
|
const chunkGraph = compilation.chunkGraph;
|
26
29
|
// These sets are hoisted here to save memory
|
@@ -6,6 +6,7 @@
|
|
6
6
|
"use strict";
|
7
7
|
|
8
8
|
/** @typedef {import("../Chunk")} Chunk */
|
9
|
+
/** @typedef {import("../Chunk").ChunkId} ChunkId */
|
9
10
|
/** @typedef {import("../Compiler")} Compiler */
|
10
11
|
/** @typedef {import("../Module")} Module */
|
11
12
|
|
@@ -61,13 +62,15 @@ class FlagIncludedChunksPlugin {
|
|
61
62
|
for (const chunk of chunks) {
|
62
63
|
let hash = 0;
|
63
64
|
for (const module of chunkGraph.getChunkModulesIterable(chunk)) {
|
64
|
-
hash |= moduleBits.get(module);
|
65
|
+
hash |= /** @type {number} */ (moduleBits.get(module));
|
65
66
|
}
|
66
67
|
chunkModulesHash.set(chunk, hash);
|
67
68
|
}
|
68
69
|
|
69
70
|
for (const chunkA of chunks) {
|
70
|
-
const chunkAHash =
|
71
|
+
const chunkAHash =
|
72
|
+
/** @type {number} */
|
73
|
+
(chunkModulesHash.get(chunkA));
|
71
74
|
const chunkAModulesCount =
|
72
75
|
chunkGraph.getNumberOfChunkModules(chunkA);
|
73
76
|
if (chunkAModulesCount === 0) continue;
|
@@ -81,7 +84,7 @@ class FlagIncludedChunksPlugin {
|
|
81
84
|
bestModule = module;
|
82
85
|
}
|
83
86
|
loopB: for (const chunkB of chunkGraph.getModuleChunksIterable(
|
84
|
-
bestModule
|
87
|
+
/** @type {Module} */ (bestModule)
|
85
88
|
)) {
|
86
89
|
// as we iterate the same iterables twice
|
87
90
|
// skip if we find ourselves
|
@@ -100,14 +103,17 @@ class FlagIncludedChunksPlugin {
|
|
100
103
|
// is chunkA in chunkB?
|
101
104
|
|
102
105
|
// we do a cheap check for the hash value
|
103
|
-
const chunkBHash =
|
106
|
+
const chunkBHash =
|
107
|
+
/** @type {number} */
|
108
|
+
(chunkModulesHash.get(chunkB));
|
104
109
|
if ((chunkBHash & chunkAHash) !== chunkAHash) continue;
|
105
110
|
|
106
111
|
// compare all modules
|
107
112
|
for (const m of chunkGraph.getChunkModulesIterable(chunkA)) {
|
108
113
|
if (!chunkGraph.isModuleInChunk(m, chunkB)) continue loopB;
|
109
114
|
}
|
110
|
-
|
115
|
+
/** @type {ChunkId[]} */
|
116
|
+
(chunkB.ids).push(/** @type {ChunkId} */ (chunkA.id));
|
111
117
|
}
|
112
118
|
}
|
113
119
|
}
|
@@ -16,7 +16,7 @@ const { UsageState } = require("../ExportsInfo");
|
|
16
16
|
/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
|
17
17
|
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
18
18
|
|
19
|
-
/** @typedef {Map<TopLevelSymbol | null, Set<string | TopLevelSymbol> | true>} InnerGraph */
|
19
|
+
/** @typedef {Map<TopLevelSymbol | null, Set<string | TopLevelSymbol> | true | undefined>} InnerGraph */
|
20
20
|
/** @typedef {function(boolean | Set<string> | undefined): void} UsageCallback */
|
21
21
|
|
22
22
|
/**
|
@@ -34,7 +34,7 @@ const topLevelSymbolTag = Symbol("top level symbol");
|
|
34
34
|
|
35
35
|
/**
|
36
36
|
* @param {ParserState} parserState parser state
|
37
|
-
* @returns {State} state
|
37
|
+
* @returns {State | undefined} state
|
38
38
|
*/
|
39
39
|
function getState(parserState) {
|
40
40
|
return parserStateMap.get(parserState);
|
@@ -235,7 +235,7 @@ exports.onUsage = (state, onUsageCallback) => {
|
|
235
235
|
|
236
236
|
/**
|
237
237
|
* @param {ParserState} state parser state
|
238
|
-
* @param {TopLevelSymbol} symbol the symbol
|
238
|
+
* @param {TopLevelSymbol | undefined} symbol the symbol
|
239
239
|
*/
|
240
240
|
exports.setTopLevelSymbol = (state, symbol) => {
|
241
241
|
const innerGraphState = getState(state);
|
@@ -260,7 +260,7 @@ exports.getTopLevelSymbol = state => {
|
|
260
260
|
/**
|
261
261
|
* @param {JavascriptParser} parser parser
|
262
262
|
* @param {string} name name of variable
|
263
|
-
* @returns {TopLevelSymbol} symbol
|
263
|
+
* @returns {TopLevelSymbol | undefined} symbol
|
264
264
|
*/
|
265
265
|
exports.tagTopLevelSymbol = (parser, name) => {
|
266
266
|
const innerGraphState = getState(parser.state);
|
@@ -309,7 +309,7 @@ exports.isDependencyUsedByExports = (
|
|
309
309
|
|
310
310
|
/**
|
311
311
|
* @param {Dependency} dependency the dependency
|
312
|
-
* @param {Set<string> | boolean} usedByExports usedByExports info
|
312
|
+
* @param {Set<string> | boolean | undefined} usedByExports usedByExports info
|
313
313
|
* @param {ModuleGraph} moduleGraph moduleGraph
|
314
314
|
* @returns {null | false | function(ModuleGraphConnection, RuntimeSpec): ConnectionState} function to determine if the connection is active
|
315
315
|
*/
|
@@ -16,6 +16,7 @@ const InnerGraph = require("./InnerGraph");
|
|
16
16
|
/** @typedef {import("estree").ClassExpression} ClassExpressionNode */
|
17
17
|
/** @typedef {import("estree").Node} Node */
|
18
18
|
/** @typedef {import("estree").VariableDeclarator} VariableDeclaratorNode */
|
19
|
+
/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */
|
19
20
|
/** @typedef {import("../Compiler")} Compiler */
|
20
21
|
/** @typedef {import("../Dependency")} Dependency */
|
21
22
|
/** @typedef {import("../dependencies/HarmonyImportSpecifierDependency")} HarmonyImportSpecifierDependency */
|
@@ -46,7 +47,7 @@ class InnerGraphPlugin {
|
|
46
47
|
|
47
48
|
/**
|
48
49
|
* @param {JavascriptParser} parser the parser
|
49
|
-
* @param {
|
50
|
+
* @param {JavascriptParserOptions} parserOptions options
|
50
51
|
* @returns {void}
|
51
52
|
*/
|
52
53
|
const handler = (parser, parserOptions) => {
|