webpack 5.90.3 → 5.92.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.
Potentially problematic release.
This version of webpack might be problematic. Click here for more details.
- package/README.md +5 -5
- package/bin/webpack.js +6 -3
- package/lib/APIPlugin.js +14 -6
- package/lib/AutomaticPrefetchPlugin.js +1 -1
- package/lib/BannerPlugin.js +3 -1
- package/lib/Cache.js +8 -2
- package/lib/CacheFacade.js +3 -3
- package/lib/Chunk.js +7 -4
- package/lib/ChunkGraph.js +52 -25
- package/lib/ChunkGroup.js +23 -17
- package/lib/CleanPlugin.js +8 -6
- package/lib/Compilation.js +295 -120
- package/lib/Compiler.js +223 -87
- package/lib/ConcatenationScope.js +3 -3
- package/lib/ConditionalInitFragment.js +4 -5
- package/lib/ContextModule.js +95 -41
- package/lib/ContextModuleFactory.js +4 -2
- package/lib/ContextReplacementPlugin.js +3 -2
- package/lib/DefinePlugin.js +18 -6
- package/lib/Dependency.js +12 -10
- package/lib/DependencyTemplate.js +17 -7
- package/lib/DllModule.js +1 -0
- package/lib/DllReferencePlugin.js +7 -3
- package/lib/EntryOptionPlugin.js +4 -1
- package/lib/EntryPlugin.js +6 -1
- package/lib/Entrypoint.js +1 -1
- package/lib/EvalDevToolModulePlugin.js +11 -0
- package/lib/ExportsInfo.js +23 -8
- package/lib/ExternalModule.js +160 -35
- package/lib/ExternalModuleFactoryPlugin.js +37 -2
- package/lib/FileSystemInfo.js +69 -42
- package/lib/FlagDependencyExportsPlugin.js +21 -7
- package/lib/Generator.js +4 -4
- package/lib/HookWebpackError.js +2 -2
- package/lib/HotModuleReplacementPlugin.js +108 -45
- package/lib/IgnorePlugin.js +4 -1
- package/lib/InitFragment.js +5 -3
- package/lib/LibManifestPlugin.js +17 -9
- package/lib/Module.js +41 -14
- package/lib/ModuleFactory.js +3 -3
- package/lib/ModuleFilenameHelpers.js +30 -17
- package/lib/ModuleGraph.js +60 -31
- package/lib/ModuleGraphConnection.js +2 -1
- package/lib/MultiCompiler.js +62 -9
- package/lib/NodeStuffPlugin.js +14 -3
- package/lib/NormalModule.js +13 -13
- package/lib/NormalModuleFactory.js +18 -9
- package/lib/NormalModuleReplacementPlugin.js +5 -1
- package/lib/Parser.js +1 -1
- package/lib/PlatformPlugin.js +39 -0
- package/lib/ProgressPlugin.js +1 -1
- package/lib/ProvidePlugin.js +3 -1
- package/lib/RawModule.js +2 -1
- package/lib/RecordIdsPlugin.js +4 -4
- package/lib/ResolverFactory.js +6 -4
- package/lib/RuntimeModule.js +4 -4
- package/lib/RuntimePlugin.js +1 -0
- package/lib/RuntimeTemplate.js +124 -52
- package/lib/SourceMapDevToolPlugin.js +4 -1
- package/lib/Stats.js +11 -4
- package/lib/Template.js +5 -5
- package/lib/TemplatedPathPlugin.js +48 -7
- package/lib/Watching.js +67 -60
- package/lib/WebpackError.js +6 -6
- package/lib/WebpackOptionsApply.js +18 -5
- package/lib/asset/AssetGenerator.js +15 -0
- package/lib/asset/RawDataUrlModule.js +3 -1
- package/lib/async-modules/AwaitDependenciesInitFragment.js +2 -2
- package/lib/buildChunkGraph.js +120 -67
- package/lib/cache/IdleFileCachePlugin.js +8 -3
- package/lib/cache/MemoryCachePlugin.js +1 -1
- package/lib/cache/MemoryWithGcCachePlugin.js +6 -2
- package/lib/cache/PackFileCacheStrategy.js +51 -18
- package/lib/cache/ResolverCachePlugin.js +22 -14
- package/lib/cache/getLazyHashedEtag.js +2 -2
- package/lib/cli.js +5 -5
- package/lib/config/browserslistTargetHandler.js +7 -1
- package/lib/config/defaults.js +108 -34
- package/lib/config/normalization.js +3 -1
- package/lib/config/target.js +18 -11
- package/lib/container/ContainerEntryDependency.js +2 -1
- package/lib/container/ContainerEntryModule.js +4 -2
- package/lib/container/ContainerPlugin.js +14 -10
- package/lib/container/FallbackModule.js +1 -1
- package/lib/container/RemoteRuntimeModule.js +12 -3
- package/lib/css/CssExportsGenerator.js +68 -25
- package/lib/css/CssGenerator.js +34 -6
- package/lib/css/CssLoadingRuntimeModule.js +217 -98
- package/lib/css/CssModulesPlugin.js +238 -107
- package/lib/css/CssParser.js +24 -15
- package/lib/css/walkCssTokens.js +1 -1
- package/lib/debug/ProfilingPlugin.js +28 -3
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +9 -5
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +4 -1
- package/lib/dependencies/CommonJsDependencyHelpers.js +2 -1
- package/lib/dependencies/CommonJsExportRequireDependency.js +33 -18
- package/lib/dependencies/CommonJsExportsDependency.js +13 -5
- package/lib/dependencies/CommonJsExportsParserPlugin.js +20 -15
- package/lib/dependencies/CommonJsImportsParserPlugin.js +1 -2
- package/lib/dependencies/ContextDependencyHelpers.js +49 -29
- package/lib/dependencies/ContextElementDependency.js +8 -1
- package/lib/dependencies/CssExportDependency.js +2 -2
- package/lib/dependencies/CssLocalIdentifierDependency.js +71 -9
- package/lib/dependencies/CssUrlDependency.js +10 -7
- package/lib/dependencies/ExportsInfoDependency.js +5 -4
- package/lib/dependencies/ExternalModuleDependency.js +4 -2
- package/lib/dependencies/ExternalModuleInitFragment.js +5 -3
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +4 -4
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +43 -23
- package/lib/dependencies/HarmonyExportHeaderDependency.js +1 -1
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +73 -32
- package/lib/dependencies/HarmonyExportInitFragment.js +10 -2
- package/lib/dependencies/HarmonyImportDependency.js +28 -12
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +70 -19
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +7 -6
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +47 -35
- package/lib/dependencies/ImportDependency.js +9 -2
- package/lib/dependencies/ImportEagerDependency.js +4 -2
- package/lib/dependencies/ImportMetaContextDependency.js +7 -0
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +25 -14
- package/lib/dependencies/ImportMetaPlugin.js +1 -1
- package/lib/dependencies/ImportParserPlugin.js +15 -5
- package/lib/dependencies/ImportWeakDependency.js +4 -2
- package/lib/dependencies/LoaderDependency.js +2 -1
- package/lib/dependencies/LoaderImportDependency.js +2 -1
- package/lib/dependencies/LoaderPlugin.js +2 -2
- package/lib/dependencies/ModuleDependency.js +4 -5
- package/lib/dependencies/PureExpressionDependency.js +64 -47
- package/lib/dependencies/RequireContextPlugin.js +1 -1
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +26 -14
- package/lib/dependencies/RequireEnsureDependency.js +1 -1
- package/lib/dependencies/URLDependency.js +7 -4
- package/lib/dependencies/WorkerDependency.js +1 -1
- package/lib/dependencies/WorkerPlugin.js +2 -1
- package/lib/dependencies/getFunctionExpression.js +3 -1
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +92 -3
- package/lib/hmr/LazyCompilationPlugin.js +2 -2
- package/lib/ids/ChunkModuleIdRangePlugin.js +1 -1
- package/lib/ids/DeterministicChunkIdsPlugin.js +1 -1
- package/lib/ids/DeterministicModuleIdsPlugin.js +1 -1
- package/lib/ids/IdHelpers.js +6 -6
- package/lib/ids/NamedChunkIdsPlugin.js +1 -1
- package/lib/ids/NamedModuleIdsPlugin.js +1 -1
- package/lib/ids/SyncModuleIdsPlugin.js +2 -2
- package/lib/index.js +11 -0
- package/lib/javascript/BasicEvaluatedExpression.js +2 -2
- package/lib/javascript/ChunkHelpers.js +2 -2
- package/lib/javascript/CommonJsChunkFormatPlugin.js +1 -1
- package/lib/javascript/JavascriptGenerator.js +0 -1
- package/lib/javascript/JavascriptModulesPlugin.js +174 -17
- package/lib/javascript/JavascriptParser.js +204 -71
- package/lib/javascript/JavascriptParserHelpers.js +1 -1
- package/lib/javascript/StartupHelpers.js +22 -5
- package/lib/library/AbstractLibraryPlugin.js +2 -2
- package/lib/library/AmdLibraryPlugin.js +2 -2
- package/lib/library/AssignLibraryPlugin.js +3 -3
- package/lib/library/ExportPropertyLibraryPlugin.js +2 -2
- package/lib/library/JsonpLibraryPlugin.js +2 -2
- package/lib/library/ModuleLibraryPlugin.js +2 -2
- package/lib/library/SystemLibraryPlugin.js +2 -2
- package/lib/library/UmdLibraryPlugin.js +33 -12
- package/lib/logging/Logger.js +27 -2
- package/lib/logging/createConsoleLogger.js +13 -9
- package/lib/node/CommonJsChunkLoadingPlugin.js +2 -1
- package/lib/node/NodeEnvironmentPlugin.js +14 -8
- package/lib/node/NodeTemplatePlugin.js +1 -1
- package/lib/node/NodeWatchFileSystem.js +37 -26
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -1
- package/lib/node/ReadFileCompileWasmPlugin.js +1 -1
- package/lib/node/RequireChunkLoadingRuntimeModule.js +2 -1
- package/lib/node/nodeConsole.js +24 -1
- package/lib/optimize/AggressiveMergingPlugin.js +1 -1
- package/lib/optimize/AggressiveSplittingPlugin.js +1 -0
- package/lib/optimize/ConcatenatedModule.js +140 -121
- package/lib/optimize/EnsureChunkConditionsPlugin.js +1 -1
- package/lib/optimize/InnerGraph.js +8 -3
- package/lib/optimize/InnerGraphPlugin.js +36 -13
- package/lib/optimize/LimitChunkCountPlugin.js +1 -2
- package/lib/optimize/ModuleConcatenationPlugin.js +13 -3
- package/lib/optimize/RealContentHashPlugin.js +3 -3
- package/lib/optimize/RemoveParentModulesPlugin.js +1 -0
- package/lib/optimize/RuntimeChunkPlugin.js +6 -1
- package/lib/optimize/SideEffectsFlagPlugin.js +48 -17
- package/lib/optimize/SplitChunksPlugin.js +10 -10
- package/lib/performance/SizeLimitsPlugin.js +13 -2
- package/lib/rules/ObjectMatcherRulePlugin.js +15 -1
- package/lib/rules/RuleSetCompiler.js +9 -7
- package/lib/runtime/EnsureChunkRuntimeModule.js +2 -1
- package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +2 -1
- package/lib/runtime/LoadScriptRuntimeModule.js +1 -1
- package/lib/runtime/StartupChunkDependenciesPlugin.js +1 -1
- package/lib/schemes/HttpUriPlugin.js +1 -1
- package/lib/serialization/BinaryMiddleware.js +4 -4
- package/lib/serialization/FileMiddleware.js +4 -3
- package/lib/serialization/NullPrototypeObjectSerializer.js +2 -2
- package/lib/serialization/ObjectMiddleware.js +8 -5
- package/lib/serialization/PlainObjectSerializer.js +2 -2
- package/lib/serialization/Serializer.js +19 -0
- package/lib/serialization/SerializerMiddleware.js +2 -2
- package/lib/serialization/SingleItemMiddleware.js +2 -2
- package/lib/serialization/types.js +1 -1
- package/lib/sharing/ConsumeSharedModule.js +2 -2
- package/lib/sharing/ConsumeSharedPlugin.js +17 -3
- package/lib/sharing/ConsumeSharedRuntimeModule.js +9 -2
- package/lib/sharing/ProvideSharedPlugin.js +13 -6
- package/lib/sharing/resolveMatchedConfigs.js +3 -3
- package/lib/sharing/utils.js +13 -6
- package/lib/stats/DefaultStatsFactoryPlugin.js +20 -20
- package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
- package/lib/stats/StatsFactory.js +2 -2
- package/lib/stats/StatsPrinter.js +6 -6
- package/lib/util/ArrayQueue.js +14 -21
- package/lib/util/AsyncQueue.js +1 -1
- package/lib/util/Queue.js +8 -2
- package/lib/util/SortableSet.js +16 -4
- package/lib/util/StackedCacheMap.js +26 -0
- package/lib/util/TupleQueue.js +8 -2
- package/lib/util/WeakTupleMap.js +57 -13
- package/lib/util/binarySearchBounds.js +1 -1
- package/lib/util/cleverMerge.js +26 -13
- package/lib/util/comparators.js +37 -15
- package/lib/util/conventions.js +129 -0
- package/lib/util/createHash.js +3 -5
- package/lib/util/deprecation.js +3 -3
- package/lib/util/deterministicGrouping.js +2 -2
- package/lib/util/findGraphRoots.js +1 -1
- package/lib/util/fs.js +383 -69
- package/lib/util/hash/BatchedHash.js +3 -0
- package/lib/util/hash/xxhash64.js +2 -2
- package/lib/util/identifier.js +5 -5
- package/lib/util/mergeScope.js +79 -0
- package/lib/util/runtime.js +2 -17
- package/lib/util/semver.js +3 -0
- package/lib/util/smartGrouping.js +3 -3
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +4 -2
- package/lib/wasm-async/AsyncWebAssemblyGenerator.js +1 -1
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +4 -2
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +3 -3
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +16 -7
- package/lib/wasm-sync/WebAssemblyGenerator.js +40 -19
- package/lib/wasm-sync/WebAssemblyModulesPlugin.js +1 -1
- package/lib/wasm-sync/WebAssemblyParser.js +7 -4
- package/lib/wasm-sync/WebAssemblyUtils.js +2 -1
- package/lib/web/FetchCompileWasmPlugin.js +1 -1
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +3 -2
- package/lib/webpack.js +19 -6
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +2 -1
- package/package.json +40 -39
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +97 -8
- package/schemas/plugins/BannerPlugin.check.js +1 -1
- package/schemas/plugins/BannerPlugin.json +5 -1
- package/schemas/plugins/css/CssAutoGeneratorOptions.check.js +1 -1
- package/schemas/plugins/css/CssGeneratorOptions.check.js +1 -1
- package/schemas/plugins/css/CssGlobalGeneratorOptions.check.js +1 -1
- package/schemas/plugins/css/CssModuleGeneratorOptions.check.js +1 -1
- package/types.d.ts +1826 -639
@@ -0,0 +1,79 @@
|
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
|
6
|
+
"use strict";
|
7
|
+
|
8
|
+
/** @typedef {import("eslint-scope").Reference} Reference */
|
9
|
+
/** @typedef {import("eslint-scope").Variable} Variable */
|
10
|
+
/** @typedef {import("../javascript/JavascriptParser").AnyNode} AnyNode */
|
11
|
+
/** @typedef {import("../javascript/JavascriptParser").Program} Program */
|
12
|
+
|
13
|
+
/**
|
14
|
+
* @param {Variable} variable variable
|
15
|
+
* @returns {Reference[]} references
|
16
|
+
*/
|
17
|
+
const getAllReferences = variable => {
|
18
|
+
let set = variable.references;
|
19
|
+
// Look for inner scope variables too (like in class Foo { t() { Foo } })
|
20
|
+
const identifiers = new Set(variable.identifiers);
|
21
|
+
for (const scope of variable.scope.childScopes) {
|
22
|
+
for (const innerVar of scope.variables) {
|
23
|
+
if (innerVar.identifiers.some(id => identifiers.has(id))) {
|
24
|
+
set = set.concat(innerVar.references);
|
25
|
+
break;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
return set;
|
30
|
+
};
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @param {Program | Program[]} ast ast
|
34
|
+
* @param {AnyNode} node node
|
35
|
+
* @returns {undefined | AnyNode[]} result
|
36
|
+
*/
|
37
|
+
const getPathInAst = (ast, node) => {
|
38
|
+
if (ast === node) {
|
39
|
+
return [];
|
40
|
+
}
|
41
|
+
|
42
|
+
const nr = node.range;
|
43
|
+
|
44
|
+
const enterNode = n => {
|
45
|
+
if (!n) return undefined;
|
46
|
+
const r = n.range;
|
47
|
+
if (r) {
|
48
|
+
if (r[0] <= nr[0] && r[1] >= nr[1]) {
|
49
|
+
const path = getPathInAst(n, node);
|
50
|
+
if (path) {
|
51
|
+
path.push(n);
|
52
|
+
return path;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
return undefined;
|
57
|
+
};
|
58
|
+
|
59
|
+
if (Array.isArray(ast)) {
|
60
|
+
for (let i = 0; i < ast.length; i++) {
|
61
|
+
const enterResult = enterNode(ast[i]);
|
62
|
+
if (enterResult !== undefined) return enterResult;
|
63
|
+
}
|
64
|
+
} else if (ast && typeof ast === "object") {
|
65
|
+
const keys = Object.keys(ast);
|
66
|
+
for (let i = 0; i < keys.length; i++) {
|
67
|
+
const value = ast[keys[i]];
|
68
|
+
if (Array.isArray(value)) {
|
69
|
+
const pathResult = getPathInAst(value, node);
|
70
|
+
if (pathResult !== undefined) return pathResult;
|
71
|
+
} else if (value && typeof value === "object") {
|
72
|
+
const enterResult = enterNode(value);
|
73
|
+
if (enterResult !== undefined) return enterResult;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
};
|
78
|
+
|
79
|
+
module.exports = { getAllReferences, getPathInAst };
|
package/lib/util/runtime.js
CHANGED
@@ -229,22 +229,6 @@ const mergeRuntime = (a, b) => {
|
|
229
229
|
};
|
230
230
|
exports.mergeRuntime = mergeRuntime;
|
231
231
|
|
232
|
-
/**
|
233
|
-
* @param {RuntimeSpec[]} runtimes first
|
234
|
-
* @param {RuntimeSpec} runtime second
|
235
|
-
* @returns {RuntimeSpec} merged
|
236
|
-
*/
|
237
|
-
exports.deepMergeRuntime = (runtimes, runtime) => {
|
238
|
-
if (!Array.isArray(runtimes)) {
|
239
|
-
return runtime;
|
240
|
-
}
|
241
|
-
let merged = runtime;
|
242
|
-
for (const r of runtimes) {
|
243
|
-
merged = mergeRuntime(runtime, r);
|
244
|
-
}
|
245
|
-
return merged;
|
246
|
-
};
|
247
|
-
|
248
232
|
/**
|
249
233
|
* @param {RuntimeCondition} a first
|
250
234
|
* @param {RuntimeCondition} b second
|
@@ -390,6 +374,7 @@ const subtractRuntime = (a, b) => {
|
|
390
374
|
}
|
391
375
|
const set = new SortableSet(a);
|
392
376
|
set.delete(b);
|
377
|
+
return set;
|
393
378
|
} else {
|
394
379
|
const set = new SortableSet();
|
395
380
|
for (const item of a) {
|
@@ -445,7 +430,7 @@ exports.filterRuntime = (runtime, filter) => {
|
|
445
430
|
/**
|
446
431
|
* @template T
|
447
432
|
* @typedef {Map<string, T>} RuntimeSpecMapInnerMap
|
448
|
-
|
433
|
+
*/
|
449
434
|
|
450
435
|
/**
|
451
436
|
* @template T
|
package/lib/util/semver.js
CHANGED
@@ -153,6 +153,9 @@ exports.parseRange = str => {
|
|
153
153
|
}
|
154
154
|
return [1, ...remainder.slice(1)];
|
155
155
|
case "~":
|
156
|
+
if (remainder.length === 2 && remainder[0] === 0) {
|
157
|
+
return [1, ...remainder.slice(1)];
|
158
|
+
}
|
156
159
|
return [2, ...remainder.slice(1)];
|
157
160
|
case ">=":
|
158
161
|
return remainder;
|
@@ -6,7 +6,7 @@
|
|
6
6
|
"use strict";
|
7
7
|
|
8
8
|
/**
|
9
|
-
* @typedef {
|
9
|
+
* @typedef {object} GroupOptions
|
10
10
|
* @property {boolean=} groupChildren
|
11
11
|
* @property {boolean=} force
|
12
12
|
* @property {number=} targetGroupCount
|
@@ -15,7 +15,7 @@
|
|
15
15
|
/**
|
16
16
|
* @template T
|
17
17
|
* @template R
|
18
|
-
* @typedef {
|
18
|
+
* @typedef {object} GroupConfig
|
19
19
|
* @property {function(T): string[]} getKeys
|
20
20
|
* @property {function(string, (R | T)[], T[]): R} createGroup
|
21
21
|
* @property {function(string, T[]): GroupOptions=} getOptions
|
@@ -24,7 +24,7 @@
|
|
24
24
|
/**
|
25
25
|
* @template T
|
26
26
|
* @template R
|
27
|
-
* @typedef {
|
27
|
+
* @typedef {object} ItemWithGroups
|
28
28
|
* @property {T} item
|
29
29
|
* @property {Set<Group<T, R>>} groups
|
30
30
|
*/
|
@@ -13,7 +13,7 @@ const Template = require("../Template");
|
|
13
13
|
/** @typedef {import("../Compilation")} Compilation */
|
14
14
|
|
15
15
|
/**
|
16
|
-
* @typedef {
|
16
|
+
* @typedef {object} AsyncWasmLoadingRuntimeModuleOptions
|
17
17
|
* @property {function(string): string} generateLoadBinaryCode
|
18
18
|
* @property {boolean} supportsStreaming
|
19
19
|
*/
|
@@ -69,7 +69,9 @@ class AsyncWasmLoadingRuntimeModule extends RuntimeModule {
|
|
69
69
|
const concat = (/** @type {string[]} */ ...text) => text.join("");
|
70
70
|
return [
|
71
71
|
`var req = ${loader};`,
|
72
|
-
`var fallback = ${runtimeTemplate.returningFunction(
|
72
|
+
`var fallback = ${runtimeTemplate.returningFunction(
|
73
|
+
Template.asString(["req", Template.indent(fallback)])
|
74
|
+
)};`,
|
73
75
|
concat(
|
74
76
|
"return req.then(",
|
75
77
|
runtimeTemplate.basicFunction("res", [
|
@@ -14,7 +14,7 @@ const Generator = require("../Generator");
|
|
14
14
|
const TYPES = new Set(["webassembly"]);
|
15
15
|
|
16
16
|
/**
|
17
|
-
* @typedef {
|
17
|
+
* @typedef {object} AsyncWebAssemblyGeneratorOptions
|
18
18
|
* @property {boolean} [mangleImports] mangle imports
|
19
19
|
*/
|
20
20
|
|
@@ -77,7 +77,7 @@ class AsyncWebAssemblyJavascriptGenerator extends Generator {
|
|
77
77
|
const wasmDepsByRequest = new Map();
|
78
78
|
for (const dep of module.dependencies) {
|
79
79
|
if (dep instanceof WebAssemblyImportDependency) {
|
80
|
-
const module = moduleGraph.getModule(dep);
|
80
|
+
const module = /** @type {Module} */ (moduleGraph.getModule(dep));
|
81
81
|
if (!depModules.has(module)) {
|
82
82
|
depModules.set(module, {
|
83
83
|
request: dep.request,
|
@@ -120,7 +120,9 @@ class AsyncWebAssemblyJavascriptGenerator extends Generator {
|
|
120
120
|
wasmDepsByRequest,
|
121
121
|
([request, deps]) => {
|
122
122
|
const exportItems = deps.map(dep => {
|
123
|
-
const importedModule =
|
123
|
+
const importedModule =
|
124
|
+
/** @type {Module} */
|
125
|
+
(moduleGraph.getModule(dep));
|
124
126
|
const importVar =
|
125
127
|
/** @type {ImportObjRequestItem} */
|
126
128
|
(depModules.get(importedModule)).importVar;
|
@@ -39,7 +39,7 @@ const getAsyncWebAssemblyParser = memoize(() =>
|
|
39
39
|
);
|
40
40
|
|
41
41
|
/**
|
42
|
-
* @typedef {
|
42
|
+
* @typedef {object} WebAssemblyRenderContext
|
43
43
|
* @property {Chunk} chunk the chunk
|
44
44
|
* @property {DependencyTemplates} dependencyTemplates the dependency templates
|
45
45
|
* @property {RuntimeTemplate} runtimeTemplate the runtime template
|
@@ -49,12 +49,12 @@ const getAsyncWebAssemblyParser = memoize(() =>
|
|
49
49
|
*/
|
50
50
|
|
51
51
|
/**
|
52
|
-
* @typedef {
|
52
|
+
* @typedef {object} CompilationHooks
|
53
53
|
* @property {SyncWaterfallHook<[Source, Module, WebAssemblyRenderContext]>} renderModuleContent
|
54
54
|
*/
|
55
55
|
|
56
56
|
/**
|
57
|
-
* @typedef {
|
57
|
+
* @typedef {object} AsyncWebAssemblyModulesPluginOptions
|
58
58
|
* @property {boolean} [mangleImports] mangle imports
|
59
59
|
*/
|
60
60
|
|
@@ -15,6 +15,7 @@ const WebAssemblyUtils = require("./WebAssemblyUtils");
|
|
15
15
|
/** @typedef {import("../ChunkGraph")} ChunkGraph */
|
16
16
|
/** @typedef {import("../Compilation")} Compilation */
|
17
17
|
/** @typedef {import("../Module")} Module */
|
18
|
+
/** @typedef {import("../Module").ReadOnlyRuntimeRequirements} ReadOnlyRuntimeRequirements */
|
18
19
|
/** @typedef {import("../ModuleGraph")} ModuleGraph */
|
19
20
|
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
20
21
|
|
@@ -61,6 +62,7 @@ const generateImportObject = (
|
|
61
62
|
runtime
|
62
63
|
) => {
|
63
64
|
const moduleGraph = chunkGraph.moduleGraph;
|
65
|
+
/** @type {Map<string, string | number>} */
|
64
66
|
const waitForInstances = new Map();
|
65
67
|
const properties = [];
|
66
68
|
const usedWasmDependencies = WebAssemblyUtils.getUsedDependencies(
|
@@ -85,7 +87,10 @@ const generateImportObject = (
|
|
85
87
|
|
86
88
|
if (direct) {
|
87
89
|
const instanceVar = `m${waitForInstances.size}`;
|
88
|
-
waitForInstances.set(
|
90
|
+
waitForInstances.set(
|
91
|
+
instanceVar,
|
92
|
+
chunkGraph.getModuleId(/** @type {Module} */ (importedModule))
|
93
|
+
);
|
89
94
|
properties.push({
|
90
95
|
module,
|
91
96
|
name,
|
@@ -99,20 +104,24 @@ const generateImportObject = (
|
|
99
104
|
);
|
100
105
|
|
101
106
|
const mod = `${RuntimeGlobals.moduleCache}[${JSON.stringify(
|
102
|
-
chunkGraph.getModuleId(importedModule)
|
107
|
+
chunkGraph.getModuleId(/** @type {Module} */ (importedModule))
|
103
108
|
)}]`;
|
104
109
|
const modExports = `${mod}.exports`;
|
105
110
|
|
106
111
|
const cache = `wasmImportedFuncCache${declarations.length}`;
|
107
112
|
declarations.push(`var ${cache};`);
|
108
113
|
|
114
|
+
const modCode =
|
115
|
+
/** @type {Module} */
|
116
|
+
(importedModule).type.startsWith("webassembly")
|
117
|
+
? `${mod} ? ${modExports}[${JSON.stringify(usedName)}] : `
|
118
|
+
: "";
|
119
|
+
|
109
120
|
properties.push({
|
110
121
|
module,
|
111
122
|
name,
|
112
123
|
value: Template.asString([
|
113
|
-
(
|
114
|
-
? `${mod} ? ${modExports}[${JSON.stringify(usedName)}] : `
|
115
|
-
: "") + `function(${params}) {`,
|
124
|
+
modCode + `function(${params}) {`,
|
116
125
|
Template.indent([
|
117
126
|
`if(${cache} === undefined) ${cache} = ${modExports};`,
|
118
127
|
`return ${cache}[${JSON.stringify(usedName)}](${params});`
|
@@ -201,11 +210,11 @@ const generateImportObject = (
|
|
201
210
|
};
|
202
211
|
|
203
212
|
/**
|
204
|
-
* @typedef {
|
213
|
+
* @typedef {object} WasmChunkLoadingRuntimeModuleOptions
|
205
214
|
* @property {(path: string) => string} generateLoadBinaryCode
|
206
215
|
* @property {boolean} [supportsStreaming]
|
207
216
|
* @property {boolean} [mangleImports]
|
208
|
-
* @property {
|
217
|
+
* @property {ReadOnlyRuntimeRequirements} runtimeRequirements
|
209
218
|
*/
|
210
219
|
|
211
220
|
class WasmChunkLoadingRuntimeModule extends RuntimeModule {
|
@@ -25,6 +25,14 @@ const WebAssemblyExportImportedDependency = require("../dependencies/WebAssembly
|
|
25
25
|
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
|
26
26
|
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
27
27
|
/** @typedef {import("./WebAssemblyUtils").UsedWasmDependency} UsedWasmDependency */
|
28
|
+
/** @typedef {import("@webassemblyjs/ast").Instruction} Instruction */
|
29
|
+
/** @typedef {import("@webassemblyjs/ast").ModuleImport} ModuleImport */
|
30
|
+
/** @typedef {import("@webassemblyjs/ast").ModuleExport} ModuleExport */
|
31
|
+
/** @typedef {import("@webassemblyjs/ast").Global} Global */
|
32
|
+
/**
|
33
|
+
* @template T
|
34
|
+
* @typedef {import("@webassemblyjs/ast").NodePath<T>} NodePath
|
35
|
+
*/
|
28
36
|
|
29
37
|
/**
|
30
38
|
* @typedef {(buf: ArrayBuffer) => ArrayBuffer} ArrayBufferTransform
|
@@ -32,7 +40,7 @@ const WebAssemblyExportImportedDependency = require("../dependencies/WebAssembly
|
|
32
40
|
|
33
41
|
/**
|
34
42
|
* @template T
|
35
|
-
* @param {
|
43
|
+
* @param {((prev: ArrayBuffer) => ArrayBuffer)[]} fns transforms
|
36
44
|
* @returns {Function} composed transform
|
37
45
|
*/
|
38
46
|
const compose = (...fns) => {
|
@@ -47,7 +55,8 @@ const compose = (...fns) => {
|
|
47
55
|
/**
|
48
56
|
* Removes the start instruction
|
49
57
|
*
|
50
|
-
* @param {
|
58
|
+
* @param {object} state state
|
59
|
+
* @param {object} state.ast Module's ast
|
51
60
|
* @returns {ArrayBufferTransform} transform
|
52
61
|
*/
|
53
62
|
const removeStartFunc = state => bin => {
|
@@ -61,7 +70,7 @@ const removeStartFunc = state => bin => {
|
|
61
70
|
/**
|
62
71
|
* Get imported globals
|
63
72
|
*
|
64
|
-
* @param {
|
73
|
+
* @param {object} ast Module's AST
|
65
74
|
* @returns {t.ModuleImport[]} - nodes
|
66
75
|
*/
|
67
76
|
const getImportedGlobals = ast => {
|
@@ -82,8 +91,8 @@ const getImportedGlobals = ast => {
|
|
82
91
|
/**
|
83
92
|
* Get the count for imported func
|
84
93
|
*
|
85
|
-
* @param {
|
86
|
-
* @returns {
|
94
|
+
* @param {object} ast Module's AST
|
95
|
+
* @returns {number} - count
|
87
96
|
*/
|
88
97
|
const getCountImportedFunc = ast => {
|
89
98
|
let count = 0;
|
@@ -102,7 +111,7 @@ const getCountImportedFunc = ast => {
|
|
102
111
|
/**
|
103
112
|
* Get next type index
|
104
113
|
*
|
105
|
-
* @param {
|
114
|
+
* @param {object} ast Module's AST
|
106
115
|
* @returns {t.Index} - index
|
107
116
|
*/
|
108
117
|
const getNextTypeIndex = ast => {
|
@@ -118,12 +127,12 @@ const getNextTypeIndex = ast => {
|
|
118
127
|
/**
|
119
128
|
* Get next func index
|
120
129
|
*
|
121
|
-
* The Func section metadata provide
|
130
|
+
* The Func section metadata provide information for implemented funcs
|
122
131
|
* in order to have the correct index we shift the index by number of external
|
123
132
|
* functions.
|
124
133
|
*
|
125
|
-
* @param {
|
126
|
-
* @param {
|
134
|
+
* @param {object} ast Module's AST
|
135
|
+
* @param {number} countImportedFunc number of imported funcs
|
127
136
|
* @returns {t.Index} - index
|
128
137
|
*/
|
129
138
|
const getNextFuncIndex = (ast, countImportedFunc) => {
|
@@ -169,7 +178,9 @@ const createDefaultInitForGlobal = globalType => {
|
|
169
178
|
*
|
170
179
|
* Note that globals will become mutable.
|
171
180
|
*
|
172
|
-
* @param {
|
181
|
+
* @param {object} state transformation state
|
182
|
+
* @param {object} state.ast Module's ast
|
183
|
+
* @param {t.Instruction[]} state.additionalInitCode list of addition instructions for the init function
|
173
184
|
* @returns {ArrayBufferTransform} transform
|
174
185
|
*/
|
175
186
|
const rewriteImportedGlobals = state => bin => {
|
@@ -180,7 +191,7 @@ const rewriteImportedGlobals = state => bin => {
|
|
180
191
|
bin = editWithAST(state.ast, bin, {
|
181
192
|
ModuleImport(path) {
|
182
193
|
if (t.isGlobalType(path.node.descr)) {
|
183
|
-
const globalType = path.node.descr;
|
194
|
+
const globalType = /** @type {TODO} */ (path.node.descr);
|
184
195
|
|
185
196
|
globalType.mutability = "var";
|
186
197
|
|
@@ -197,6 +208,9 @@ const rewriteImportedGlobals = state => bin => {
|
|
197
208
|
|
198
209
|
// in order to preserve non-imported global's order we need to re-inject
|
199
210
|
// those as well
|
211
|
+
/**
|
212
|
+
* @param {NodePath<Global>} path path
|
213
|
+
*/
|
200
214
|
Global(path) {
|
201
215
|
const { node } = path;
|
202
216
|
const [init] = node.init;
|
@@ -234,8 +248,8 @@ const rewriteImportedGlobals = state => bin => {
|
|
234
248
|
|
235
249
|
/**
|
236
250
|
* Rewrite the export names
|
237
|
-
* @param {
|
238
|
-
* @param {
|
251
|
+
* @param {object} state state
|
252
|
+
* @param {object} state.ast Module's ast
|
239
253
|
* @param {Module} state.module Module
|
240
254
|
* @param {ModuleGraph} state.moduleGraph module graph
|
241
255
|
* @param {Set<string>} state.externalExports Module
|
@@ -246,6 +260,9 @@ const rewriteExportNames =
|
|
246
260
|
({ ast, moduleGraph, module, externalExports, runtime }) =>
|
247
261
|
bin => {
|
248
262
|
return editWithAST(ast, bin, {
|
263
|
+
/**
|
264
|
+
* @param {NodePath<ModuleExport>} path path
|
265
|
+
*/
|
249
266
|
ModuleExport(path) {
|
250
267
|
const isExternal = externalExports.has(path.node.name);
|
251
268
|
if (isExternal) {
|
@@ -259,15 +276,15 @@ const rewriteExportNames =
|
|
259
276
|
path.remove();
|
260
277
|
return;
|
261
278
|
}
|
262
|
-
path.node.name = usedName;
|
279
|
+
path.node.name = /** @type {string} */ (usedName);
|
263
280
|
}
|
264
281
|
});
|
265
282
|
};
|
266
283
|
|
267
284
|
/**
|
268
285
|
* Mangle import names and modules
|
269
|
-
* @param {
|
270
|
-
* @param {
|
286
|
+
* @param {object} state state
|
287
|
+
* @param {object} state.ast Module's ast
|
271
288
|
* @param {Map<string, UsedWasmDependency>} state.usedDependencyMap mappings to mangle names
|
272
289
|
* @returns {ArrayBufferTransform} transform
|
273
290
|
*/
|
@@ -275,6 +292,9 @@ const rewriteImports =
|
|
275
292
|
({ ast, usedDependencyMap }) =>
|
276
293
|
bin => {
|
277
294
|
return editWithAST(ast, bin, {
|
295
|
+
/**
|
296
|
+
* @param {NodePath<ModuleImport>} path path
|
297
|
+
*/
|
278
298
|
ModuleImport(path) {
|
279
299
|
const result = usedDependencyMap.get(
|
280
300
|
path.node.module + ":" + path.node.name
|
@@ -293,8 +313,8 @@ const rewriteImports =
|
|
293
313
|
*
|
294
314
|
* The init function fills the globals given input arguments.
|
295
315
|
*
|
296
|
-
* @param {
|
297
|
-
* @param {
|
316
|
+
* @param {object} state transformation state
|
317
|
+
* @param {object} state.ast Module's ast
|
298
318
|
* @param {t.Identifier} state.initFuncId identifier of the init function
|
299
319
|
* @param {t.Index} state.startAtFuncOffset index of the start function
|
300
320
|
* @param {t.ModuleImport[]} state.importedGlobals list of imported globals
|
@@ -326,6 +346,7 @@ const addInitFunction =
|
|
326
346
|
);
|
327
347
|
});
|
328
348
|
|
349
|
+
/** @type {Instruction[]} */
|
329
350
|
const funcBody = [];
|
330
351
|
importedGlobals.forEach((importedGlobal, index) => {
|
331
352
|
const args = [t.indexLiteral(index)];
|
@@ -397,7 +418,7 @@ const getUsedDependencyMap = (moduleGraph, module, mangle) => {
|
|
397
418
|
const TYPES = new Set(["webassembly"]);
|
398
419
|
|
399
420
|
/**
|
400
|
-
* @typedef {
|
421
|
+
* @typedef {object} WebAssemblyGeneratorOptions
|
401
422
|
* @property {boolean} [mangleImports] mangle imports
|
402
423
|
*/
|
403
424
|
|
@@ -31,7 +31,7 @@ const getWebAssemblyParser = memoize(() => require("./WebAssemblyParser"));
|
|
31
31
|
const PLUGIN_NAME = "WebAssemblyModulesPlugin";
|
32
32
|
|
33
33
|
/**
|
34
|
-
* @typedef {
|
34
|
+
* @typedef {object} WebAssemblyModulesPluginOptions
|
35
35
|
* @property {boolean} [mangleImports] mangle imports
|
36
36
|
*/
|
37
37
|
|
@@ -97,8 +97,9 @@ class WebAssemblyParser extends Parser {
|
|
97
97
|
// extract imports and exports
|
98
98
|
/** @type {string[]} */
|
99
99
|
const exports = [];
|
100
|
-
|
101
|
-
|
100
|
+
const buildMeta = /** @type {BuildMeta} */ (state.module.buildMeta);
|
101
|
+
/** @type {Record<string, string> | undefined} */
|
102
|
+
let jsIncompatibleExports = (buildMeta.jsIncompatibleExports = undefined);
|
102
103
|
|
103
104
|
/** @type {TODO[]} */
|
104
105
|
const importedGlobals = [];
|
@@ -118,7 +119,8 @@ class WebAssemblyParser extends Parser {
|
|
118
119
|
if (incompatibleType) {
|
119
120
|
if (jsIncompatibleExports === undefined) {
|
120
121
|
jsIncompatibleExports =
|
121
|
-
|
122
|
+
/** @type {BuildMeta} */
|
123
|
+
(state.module.buildMeta).jsIncompatibleExports = {};
|
122
124
|
}
|
123
125
|
jsIncompatibleExports[node.name] = incompatibleType;
|
124
126
|
}
|
@@ -127,7 +129,8 @@ class WebAssemblyParser extends Parser {
|
|
127
129
|
exports.push(node.name);
|
128
130
|
|
129
131
|
if (node.descr && node.descr.exportType === "Global") {
|
130
|
-
const refNode =
|
132
|
+
const refNode =
|
133
|
+
importedGlobals[/** @type {TODO} */ (node.descr.id.value)];
|
131
134
|
if (refNode) {
|
132
135
|
const dep = new WebAssemblyExportImportedDependency(
|
133
136
|
node.name,
|
@@ -11,7 +11,8 @@ const WebAssemblyImportDependency = require("../dependencies/WebAssemblyImportDe
|
|
11
11
|
/** @typedef {import("../Module")} Module */
|
12
12
|
/** @typedef {import("../ModuleGraph")} ModuleGraph */
|
13
13
|
|
14
|
-
/**
|
14
|
+
/**
|
15
|
+
* @typedef {object} UsedWasmDependency
|
15
16
|
* @property {WebAssemblyImportDependency} dependency the dependency
|
16
17
|
* @property {string} name the export name
|
17
18
|
* @property {string} module the module name
|
@@ -17,7 +17,7 @@ const WasmChunkLoadingRuntimeModule = require("../wasm-sync/WasmChunkLoadingRunt
|
|
17
17
|
const PLUGIN_NAME = "FetchCompileWasmPlugin";
|
18
18
|
|
19
19
|
/**
|
20
|
-
* @typedef {
|
20
|
+
* @typedef {object} FetchCompileWasmPluginOptions
|
21
21
|
* @property {boolean} [mangleImports] mangle imports
|
22
22
|
*/
|
23
23
|
|
@@ -15,9 +15,10 @@ const compileBooleanMatcher = require("../util/compileBooleanMatcher");
|
|
15
15
|
|
16
16
|
/** @typedef {import("../Chunk")} Chunk */
|
17
17
|
/** @typedef {import("../ChunkGraph")} ChunkGraph */
|
18
|
+
/** @typedef {import("../Module").ReadOnlyRuntimeRequirements} ReadOnlyRuntimeRequirements */
|
18
19
|
|
19
20
|
/**
|
20
|
-
* @typedef {
|
21
|
+
* @typedef {object} JsonpCompilationPluginHooks
|
21
22
|
* @property {SyncWaterfallHook<[string, Chunk]>} linkPreload
|
22
23
|
* @property {SyncWaterfallHook<[string, Chunk]>} linkPrefetch
|
23
24
|
*/
|
@@ -48,7 +49,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
|
|
48
49
|
}
|
49
50
|
|
50
51
|
/**
|
51
|
-
* @param {
|
52
|
+
* @param {ReadOnlyRuntimeRequirements} runtimeRequirements runtime requirements
|
52
53
|
*/
|
53
54
|
constructor(runtimeRequirements) {
|
54
55
|
super("jsonp chunk loading", RuntimeModule.STAGE_ATTACH);
|
package/lib/webpack.js
CHANGED
@@ -31,7 +31,7 @@ const getValidateSchema = memoize(() => require("./validateSchema"));
|
|
31
31
|
/**
|
32
32
|
* @template T
|
33
33
|
* @callback Callback
|
34
|
-
* @param {
|
34
|
+
* @param {Error | null} err
|
35
35
|
* @param {T=} stats
|
36
36
|
* @returns {void}
|
37
37
|
*/
|
@@ -42,7 +42,9 @@ const getValidateSchema = memoize(() => require("./validateSchema"));
|
|
42
42
|
* @returns {MultiCompiler} a multi-compiler
|
43
43
|
*/
|
44
44
|
const createMultiCompiler = (childOptions, options) => {
|
45
|
-
const compilers = childOptions.map(options =>
|
45
|
+
const compilers = childOptions.map((options, index) =>
|
46
|
+
createCompiler(options, index)
|
47
|
+
);
|
46
48
|
const compiler = new MultiCompiler(compilers, options);
|
47
49
|
for (const childCompiler of compilers) {
|
48
50
|
if (childCompiler.options.dependencies) {
|
@@ -57,9 +59,10 @@ const createMultiCompiler = (childOptions, options) => {
|
|
57
59
|
|
58
60
|
/**
|
59
61
|
* @param {WebpackOptions} rawOptions options object
|
62
|
+
* @param {number} [compilerIndex] index of compiler
|
60
63
|
* @returns {Compiler} a compiler
|
61
64
|
*/
|
62
|
-
const createCompiler = rawOptions => {
|
65
|
+
const createCompiler = (rawOptions, compilerIndex) => {
|
63
66
|
const options = getNormalizedWebpackOptions(rawOptions);
|
64
67
|
applyWebpackOptionsBaseDefaults(options);
|
65
68
|
const compiler = new Compiler(
|
@@ -79,7 +82,13 @@ const createCompiler = rawOptions => {
|
|
79
82
|
}
|
80
83
|
}
|
81
84
|
}
|
82
|
-
applyWebpackOptionsDefaults(
|
85
|
+
const resolvedDefaultOptions = applyWebpackOptionsDefaults(
|
86
|
+
options,
|
87
|
+
compilerIndex
|
88
|
+
);
|
89
|
+
if (resolvedDefaultOptions.platform) {
|
90
|
+
compiler.platform = resolvedDefaultOptions.platform;
|
91
|
+
}
|
83
92
|
compiler.hooks.environment.call();
|
84
93
|
compiler.hooks.afterEnvironment.call();
|
85
94
|
new WebpackOptionsApply().process(options, compiler);
|
@@ -113,7 +122,7 @@ const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ (
|
|
113
122
|
/**
|
114
123
|
* @param {WebpackOptions | (ReadonlyArray<WebpackOptions> & MultiCompilerOptions)} options options
|
115
124
|
* @param {Callback<Stats> & Callback<MultiStats>=} callback callback
|
116
|
-
* @returns {Compiler | MultiCompiler} Compiler or MultiCompiler
|
125
|
+
* @returns {Compiler | MultiCompiler | null} Compiler or MultiCompiler
|
117
126
|
*/
|
118
127
|
(options, callback) => {
|
119
128
|
const create = () => {
|
@@ -156,7 +165,11 @@ const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ (
|
|
156
165
|
} else {
|
157
166
|
compiler.run((err, stats) => {
|
158
167
|
compiler.close(err2 => {
|
159
|
-
callback(
|
168
|
+
callback(
|
169
|
+
err || err2,
|
170
|
+
/** @type {options extends WebpackOptions ? Stats : MultiStats} */
|
171
|
+
(stats)
|
172
|
+
);
|
160
173
|
});
|
161
174
|
});
|
162
175
|
}
|
@@ -18,10 +18,11 @@ const { getUndoPath } = require("../util/identifier");
|
|
18
18
|
/** @typedef {import("../Chunk")} Chunk */
|
19
19
|
/** @typedef {import("../ChunkGraph")} ChunkGraph */
|
20
20
|
/** @typedef {import("../Compilation")} Compilation */
|
21
|
+
/** @typedef {import("../Module").ReadOnlyRuntimeRequirements} ReadOnlyRuntimeRequirements */
|
21
22
|
|
22
23
|
class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
|
23
24
|
/**
|
24
|
-
* @param {
|
25
|
+
* @param {ReadOnlyRuntimeRequirements} runtimeRequirements runtime requirements
|
25
26
|
* @param {boolean} withCreateScriptUrl with createScriptUrl support
|
26
27
|
*/
|
27
28
|
constructor(runtimeRequirements, withCreateScriptUrl) {
|