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
@@ -9,6 +9,7 @@ const { UsageState } = require("../ExportsInfo");
|
|
9
9
|
|
10
10
|
/** @typedef {import("estree").Node} AnyNode */
|
11
11
|
/** @typedef {import("../Dependency")} Dependency */
|
12
|
+
/** @typedef {import("../Module")} Module */
|
12
13
|
/** @typedef {import("../ModuleGraph")} ModuleGraph */
|
13
14
|
/** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */
|
14
15
|
/** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */
|
@@ -20,7 +21,7 @@ const { UsageState } = require("../ExportsInfo");
|
|
20
21
|
/** @typedef {function(boolean | Set<string> | undefined): void} UsageCallback */
|
21
22
|
|
22
23
|
/**
|
23
|
-
* @typedef {
|
24
|
+
* @typedef {object} StateObject
|
24
25
|
* @property {InnerGraph} innerGraph
|
25
26
|
* @property {TopLevelSymbol=} currentTopLevelSymbol
|
26
27
|
* @property {Map<TopLevelSymbol, Set<UsageCallback>>} usageCallbackMap
|
@@ -295,7 +296,9 @@ exports.isDependencyUsedByExports = (
|
|
295
296
|
) => {
|
296
297
|
if (usedByExports === false) return false;
|
297
298
|
if (usedByExports !== true && usedByExports !== undefined) {
|
298
|
-
const selfModule =
|
299
|
+
const selfModule =
|
300
|
+
/** @type {Module} */
|
301
|
+
(moduleGraph.getParentModule(dependency));
|
299
302
|
const exportsInfo = moduleGraph.getExportsInfo(selfModule);
|
300
303
|
let used = false;
|
301
304
|
for (const exportName of usedByExports) {
|
@@ -320,7 +323,9 @@ exports.getDependencyUsedByExportsCondition = (
|
|
320
323
|
) => {
|
321
324
|
if (usedByExports === false) return false;
|
322
325
|
if (usedByExports !== true && usedByExports !== undefined) {
|
323
|
-
const selfModule =
|
326
|
+
const selfModule =
|
327
|
+
/** @type {Module} */
|
328
|
+
(moduleGraph.getParentModule(dependency));
|
324
329
|
const exportsInfo = moduleGraph.getExportsInfo(selfModule);
|
325
330
|
return (connections, runtime) => {
|
326
331
|
for (const exportName of usedByExports) {
|
@@ -19,8 +19,10 @@ const InnerGraph = require("./InnerGraph");
|
|
19
19
|
/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */
|
20
20
|
/** @typedef {import("../Compiler")} Compiler */
|
21
21
|
/** @typedef {import("../Dependency")} Dependency */
|
22
|
+
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
22
23
|
/** @typedef {import("../dependencies/HarmonyImportSpecifierDependency")} HarmonyImportSpecifierDependency */
|
23
24
|
/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
|
25
|
+
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
|
24
26
|
/** @typedef {import("./InnerGraph").InnerGraph} InnerGraph */
|
25
27
|
/** @typedef {import("./InnerGraph").TopLevelSymbol} TopLevelSymbol */
|
26
28
|
|
@@ -123,7 +125,10 @@ class InnerGraphPlugin {
|
|
123
125
|
if (parser.scope.topLevelScope === true) {
|
124
126
|
if (
|
125
127
|
statement.type === "ClassDeclaration" &&
|
126
|
-
parser.isPure(
|
128
|
+
parser.isPure(
|
129
|
+
statement,
|
130
|
+
/** @type {Range} */ (statement.range)[0]
|
131
|
+
)
|
127
132
|
) {
|
128
133
|
const name = statement.id ? statement.id.name : "*default*";
|
129
134
|
const fn = InnerGraph.tagTopLevelSymbol(parser, name);
|
@@ -137,10 +142,12 @@ class InnerGraphPlugin {
|
|
137
142
|
if (
|
138
143
|
(decl.type === "ClassExpression" ||
|
139
144
|
decl.type === "ClassDeclaration") &&
|
140
|
-
parser.isPure(decl, decl.range[0])
|
145
|
+
parser.isPure(decl, /** @type {Range} */ (decl.range)[0])
|
141
146
|
) {
|
142
147
|
classWithTopLevelSymbol.set(decl, fn);
|
143
|
-
} else if (
|
148
|
+
} else if (
|
149
|
+
parser.isPure(decl, /** @type {Range} */ (statement.range)[0])
|
150
|
+
) {
|
144
151
|
statementWithTopLevelSymbol.set(statement, fn);
|
145
152
|
if (
|
146
153
|
!decl.type.endsWith("FunctionExpression") &&
|
@@ -164,11 +171,19 @@ class InnerGraphPlugin {
|
|
164
171
|
const name = decl.id.name;
|
165
172
|
if (
|
166
173
|
decl.init.type === "ClassExpression" &&
|
167
|
-
parser.isPure(
|
174
|
+
parser.isPure(
|
175
|
+
decl.init,
|
176
|
+
/** @type {Range} */ (decl.id.range)[1]
|
177
|
+
)
|
168
178
|
) {
|
169
179
|
const fn = InnerGraph.tagTopLevelSymbol(parser, name);
|
170
180
|
classWithTopLevelSymbol.set(decl.init, fn);
|
171
|
-
} else if (
|
181
|
+
} else if (
|
182
|
+
parser.isPure(
|
183
|
+
decl.init,
|
184
|
+
/** @type {Range} */ (decl.id.range)[1]
|
185
|
+
)
|
186
|
+
) {
|
172
187
|
const fn = InnerGraph.tagTopLevelSymbol(parser, name);
|
173
188
|
declWithTopLevelSymbol.set(decl, fn);
|
174
189
|
if (
|
@@ -214,9 +229,11 @@ class InnerGraphPlugin {
|
|
214
229
|
return;
|
215
230
|
default: {
|
216
231
|
const dep = new PureExpressionDependency(
|
217
|
-
purePart.range
|
232
|
+
/** @type {Range} */ (purePart.range)
|
218
233
|
);
|
219
|
-
dep.loc =
|
234
|
+
dep.loc =
|
235
|
+
/** @type {DependencyLocation} */
|
236
|
+
(statement.loc);
|
220
237
|
dep.usedByExports = usedByExports;
|
221
238
|
parser.state.module.addDependency(dep);
|
222
239
|
break;
|
@@ -238,7 +255,9 @@ class InnerGraphPlugin {
|
|
238
255
|
fn &&
|
239
256
|
parser.isPure(
|
240
257
|
expr,
|
241
|
-
statement.id
|
258
|
+
statement.id
|
259
|
+
? /** @type {Range} */ (statement.id.range)[1]
|
260
|
+
: /** @type {Range} */ (statement.range)[0]
|
242
261
|
)
|
243
262
|
) {
|
244
263
|
InnerGraph.setTopLevelSymbol(parser.state, fn);
|
@@ -272,7 +291,9 @@ class InnerGraphPlugin {
|
|
272
291
|
!element.static ||
|
273
292
|
parser.isPure(
|
274
293
|
expression,
|
275
|
-
element.key
|
294
|
+
element.key
|
295
|
+
? /** @type {Range} */ (element.key.range)[1]
|
296
|
+
: /** @type {Range} */ (element.range)[0]
|
276
297
|
)
|
277
298
|
) {
|
278
299
|
InnerGraph.setTopLevelSymbol(parser.state, fn);
|
@@ -284,9 +305,11 @@ class InnerGraphPlugin {
|
|
284
305
|
return;
|
285
306
|
default: {
|
286
307
|
const dep = new PureExpressionDependency(
|
287
|
-
expression.range
|
308
|
+
/** @type {Range} */ (expression.range)
|
288
309
|
);
|
289
|
-
dep.loc =
|
310
|
+
dep.loc =
|
311
|
+
/** @type {DependencyLocation} */
|
312
|
+
(expression.loc);
|
290
313
|
dep.usedByExports = usedByExports;
|
291
314
|
parser.state.module.addDependency(dep);
|
292
315
|
break;
|
@@ -321,9 +344,9 @@ class InnerGraphPlugin {
|
|
321
344
|
return;
|
322
345
|
default: {
|
323
346
|
const dep = new PureExpressionDependency(
|
324
|
-
decl.init.range
|
347
|
+
/** @type {Range} */ (decl.init.range)
|
325
348
|
);
|
326
|
-
dep.loc = decl.loc;
|
349
|
+
dep.loc = /** @type {DependencyLocation} */ (decl.loc);
|
327
350
|
dep.usedByExports = usedByExports;
|
328
351
|
parser.state.module.addDependency(dep);
|
329
352
|
break;
|
@@ -24,7 +24,7 @@ const validate = createSchemaValidation(
|
|
24
24
|
);
|
25
25
|
|
26
26
|
/**
|
27
|
-
* @typedef {
|
27
|
+
* @typedef {object} ChunkCombination
|
28
28
|
* @property {boolean} deleted this is set to true when combination was removed
|
29
29
|
* @property {number} sizeDiff
|
30
30
|
* @property {number} integratedSize
|
@@ -159,7 +159,6 @@ class LimitChunkCountPlugin {
|
|
159
159
|
const modifiedChunks = new Set();
|
160
160
|
|
161
161
|
let changed = false;
|
162
|
-
// eslint-disable-next-line no-constant-condition
|
163
162
|
loop: while (true) {
|
164
163
|
const combination = combinations.popFirst();
|
165
164
|
if (combination === undefined) break;
|
@@ -23,11 +23,12 @@ const ConcatenatedModule = require("./ConcatenatedModule");
|
|
23
23
|
/** @typedef {import("../Compilation")} Compilation */
|
24
24
|
/** @typedef {import("../Compiler")} Compiler */
|
25
25
|
/** @typedef {import("../Module")} Module */
|
26
|
+
/** @typedef {import("../Module").BuildInfo} BuildInfo */
|
26
27
|
/** @typedef {import("../RequestShortener")} RequestShortener */
|
27
28
|
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
28
29
|
|
29
30
|
/**
|
30
|
-
* @typedef {
|
31
|
+
* @typedef {object} Statistics
|
31
32
|
* @property {number} cached
|
32
33
|
* @property {number} alreadyInConfig
|
33
34
|
* @property {number} invalidModule
|
@@ -49,6 +50,9 @@ const formatBailoutReason = msg => {
|
|
49
50
|
};
|
50
51
|
|
51
52
|
class ModuleConcatenationPlugin {
|
53
|
+
/**
|
54
|
+
* @param {TODO} options options
|
55
|
+
*/
|
52
56
|
constructor(options) {
|
53
57
|
if (typeof options !== "object") options = {};
|
54
58
|
this.options = options;
|
@@ -171,7 +175,7 @@ class ModuleConcatenationPlugin {
|
|
171
175
|
}
|
172
176
|
|
173
177
|
// Must be in strict mode
|
174
|
-
if (!module.buildInfo.strict) {
|
178
|
+
if (!(/** @type {BuildInfo} */ (module.buildInfo).strict)) {
|
175
179
|
setBailoutReason(module, `Module is not in strict mode`);
|
176
180
|
continue;
|
177
181
|
}
|
@@ -242,7 +246,10 @@ class ModuleConcatenationPlugin {
|
|
242
246
|
// this improves performance, because modules already selected as inner are skipped
|
243
247
|
logger.time("sort relevant modules");
|
244
248
|
relevantModules.sort((a, b) => {
|
245
|
-
return
|
249
|
+
return (
|
250
|
+
/** @type {number} */ (moduleGraph.getDepth(a)) -
|
251
|
+
/** @type {number} */ (moduleGraph.getDepth(b))
|
252
|
+
);
|
246
253
|
});
|
247
254
|
logger.timeEnd("sort relevant modules");
|
248
255
|
|
@@ -927,6 +934,9 @@ class ConcatConfiguration {
|
|
927
934
|
return this.modules.size;
|
928
935
|
}
|
929
936
|
|
937
|
+
/**
|
938
|
+
* @param {number} snapshot snapshot
|
939
|
+
*/
|
930
940
|
rollback(snapshot) {
|
931
941
|
const modules = this.modules;
|
932
942
|
for (const m of modules) {
|
@@ -87,7 +87,7 @@ const toCachedSource = source => {
|
|
87
87
|
/** @typedef {Set<string>} Hashes */
|
88
88
|
|
89
89
|
/**
|
90
|
-
* @typedef {
|
90
|
+
* @typedef {object} AssetInfoForRealContentHash
|
91
91
|
* @property {string} name
|
92
92
|
* @property {AssetInfo} info
|
93
93
|
* @property {Source} source
|
@@ -102,7 +102,7 @@ const toCachedSource = source => {
|
|
102
102
|
*/
|
103
103
|
|
104
104
|
/**
|
105
|
-
* @typedef {
|
105
|
+
* @typedef {object} CompilationHooks
|
106
106
|
* @property {SyncBailHook<[Buffer[], string], string>} updateHash
|
107
107
|
*/
|
108
108
|
|
@@ -131,7 +131,7 @@ class RealContentHashPlugin {
|
|
131
131
|
}
|
132
132
|
|
133
133
|
/**
|
134
|
-
* @param {
|
134
|
+
* @param {object} options options object
|
135
135
|
* @param {string | Hash} options.hashFunction the hash function to use
|
136
136
|
* @param {string} options.hashDigest the hash digest to use
|
137
137
|
*/
|
@@ -10,6 +10,9 @@
|
|
10
10
|
/** @typedef {import("../Entrypoint")} Entrypoint */
|
11
11
|
|
12
12
|
class RuntimeChunkPlugin {
|
13
|
+
/**
|
14
|
+
* @param {{ name?: (entrypoint: { name: string }) => string }} options options
|
15
|
+
*/
|
13
16
|
constructor(options) {
|
14
17
|
this.options = {
|
15
18
|
/**
|
@@ -37,7 +40,9 @@ class RuntimeChunkPlugin {
|
|
37
40
|
(compilation.entries.get(entryName));
|
38
41
|
if (data.options.runtime === undefined && !data.options.dependOn) {
|
39
42
|
// Determine runtime chunk name
|
40
|
-
let name =
|
43
|
+
let name =
|
44
|
+
/** @type {string | ((entrypoint: { name: string }) => string)} */
|
45
|
+
(this.options.name);
|
41
46
|
if (typeof name === "function") {
|
42
47
|
name = name({ name: entryName });
|
43
48
|
}
|
@@ -20,23 +20,28 @@ const formatLocation = require("../formatLocation");
|
|
20
20
|
/** @typedef {import("estree").Statement} Statement */
|
21
21
|
/** @typedef {import("../Compiler")} Compiler */
|
22
22
|
/** @typedef {import("../Dependency")} Dependency */
|
23
|
+
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
23
24
|
/** @typedef {import("../Module")} Module */
|
25
|
+
/** @typedef {import("../Module").BuildMeta} BuildMeta */
|
24
26
|
/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
|
27
|
+
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
|
25
28
|
|
26
29
|
/**
|
27
|
-
* @typedef {
|
30
|
+
* @typedef {object} ExportInModule
|
28
31
|
* @property {Module} module the module
|
29
32
|
* @property {string} exportName the name of the export
|
30
33
|
* @property {boolean} checked if the export is conditional
|
31
34
|
*/
|
32
35
|
|
33
36
|
/**
|
34
|
-
* @typedef {
|
37
|
+
* @typedef {object} ReexportInfo
|
35
38
|
* @property {Map<string, ExportInModule[]>} static
|
36
39
|
* @property {Map<Module, Set<string>>} dynamic
|
37
40
|
*/
|
38
41
|
|
39
|
-
/** @
|
42
|
+
/** @typedef {Map<string, RegExp>} CacheItem */
|
43
|
+
|
44
|
+
/** @type {WeakMap<any, CacheItem>} */
|
40
45
|
const globToRegexpCache = new WeakMap();
|
41
46
|
|
42
47
|
/**
|
@@ -96,7 +101,7 @@ class SideEffectsFlagPlugin {
|
|
96
101
|
const hasSideEffects = SideEffectsFlagPlugin.moduleHasSideEffects(
|
97
102
|
resolveData.relativePath,
|
98
103
|
sideEffects,
|
99
|
-
cache
|
104
|
+
/** @type {CacheItem} */ (cache)
|
100
105
|
);
|
101
106
|
module.factoryMeta.sideEffectFree = !hasSideEffects;
|
102
107
|
}
|
@@ -132,7 +137,10 @@ class SideEffectsFlagPlugin {
|
|
132
137
|
switch (statement.type) {
|
133
138
|
case "ExpressionStatement":
|
134
139
|
if (
|
135
|
-
!parser.isPure(
|
140
|
+
!parser.isPure(
|
141
|
+
statement.expression,
|
142
|
+
/** @type {Range} */ (statement.range)[0]
|
143
|
+
)
|
136
144
|
) {
|
137
145
|
sideEffectsStatement = statement;
|
138
146
|
}
|
@@ -140,27 +148,35 @@ class SideEffectsFlagPlugin {
|
|
140
148
|
case "IfStatement":
|
141
149
|
case "WhileStatement":
|
142
150
|
case "DoWhileStatement":
|
143
|
-
if (
|
151
|
+
if (
|
152
|
+
!parser.isPure(
|
153
|
+
statement.test,
|
154
|
+
/** @type {Range} */ (statement.range)[0]
|
155
|
+
)
|
156
|
+
) {
|
144
157
|
sideEffectsStatement = statement;
|
145
158
|
}
|
146
159
|
// statement hook will be called for child statements too
|
147
160
|
break;
|
148
161
|
case "ForStatement":
|
149
162
|
if (
|
150
|
-
!parser.isPure(
|
163
|
+
!parser.isPure(
|
164
|
+
statement.init,
|
165
|
+
/** @type {Range} */ (statement.range)[0]
|
166
|
+
) ||
|
151
167
|
!parser.isPure(
|
152
168
|
statement.test,
|
153
169
|
statement.init
|
154
|
-
? statement.init.range[1]
|
155
|
-
: statement.range[0]
|
170
|
+
? /** @type {Range} */ (statement.init.range)[1]
|
171
|
+
: /** @type {Range} */ (statement.range)[0]
|
156
172
|
) ||
|
157
173
|
!parser.isPure(
|
158
174
|
statement.update,
|
159
175
|
statement.test
|
160
|
-
? statement.test.range[1]
|
176
|
+
? /** @type {Range} */ (statement.test.range)[1]
|
161
177
|
: statement.init
|
162
|
-
? statement.init.range[1]
|
163
|
-
: statement.range[0]
|
178
|
+
? /** @type {Range} */ (statement.init.range)[1]
|
179
|
+
: /** @type {Range} */ (statement.range)[0]
|
164
180
|
)
|
165
181
|
) {
|
166
182
|
sideEffectsStatement = statement;
|
@@ -169,7 +185,10 @@ class SideEffectsFlagPlugin {
|
|
169
185
|
break;
|
170
186
|
case "SwitchStatement":
|
171
187
|
if (
|
172
|
-
!parser.isPure(
|
188
|
+
!parser.isPure(
|
189
|
+
statement.discriminant,
|
190
|
+
/** @type {Range} */ (statement.range)[0]
|
191
|
+
)
|
173
192
|
) {
|
174
193
|
sideEffectsStatement = statement;
|
175
194
|
}
|
@@ -178,14 +197,22 @@ class SideEffectsFlagPlugin {
|
|
178
197
|
case "VariableDeclaration":
|
179
198
|
case "ClassDeclaration":
|
180
199
|
case "FunctionDeclaration":
|
181
|
-
if (
|
200
|
+
if (
|
201
|
+
!parser.isPure(
|
202
|
+
statement,
|
203
|
+
/** @type {Range} */ (statement.range)[0]
|
204
|
+
)
|
205
|
+
) {
|
182
206
|
sideEffectsStatement = statement;
|
183
207
|
}
|
184
208
|
break;
|
185
209
|
case "ExportNamedDeclaration":
|
186
210
|
case "ExportDefaultDeclaration":
|
187
211
|
if (
|
188
|
-
!parser.isPure(
|
212
|
+
!parser.isPure(
|
213
|
+
statement.declaration,
|
214
|
+
/** @type {Range} */ (statement.range)[0]
|
215
|
+
)
|
189
216
|
) {
|
190
217
|
sideEffectsStatement = statement;
|
191
218
|
}
|
@@ -208,7 +235,8 @@ class SideEffectsFlagPlugin {
|
|
208
235
|
);
|
209
236
|
parser.hooks.finish.tap(PLUGIN_NAME, () => {
|
210
237
|
if (sideEffectsStatement === undefined) {
|
211
|
-
|
238
|
+
/** @type {BuildMeta} */
|
239
|
+
(parser.state.module.buildMeta).sideEffectFree = true;
|
212
240
|
} else {
|
213
241
|
const { loc, type } = sideEffectsStatement;
|
214
242
|
moduleGraph
|
@@ -216,7 +244,7 @@ class SideEffectsFlagPlugin {
|
|
216
244
|
.push(
|
217
245
|
() =>
|
218
246
|
`Statement (${type}) with side effects in source code at ${formatLocation(
|
219
|
-
loc
|
247
|
+
/** @type {DependencyLocation} */ (loc)
|
220
248
|
)}`
|
221
249
|
);
|
222
250
|
}
|
@@ -246,6 +274,9 @@ class SideEffectsFlagPlugin {
|
|
246
274
|
|
247
275
|
const optimizedModules = new Set();
|
248
276
|
|
277
|
+
/**
|
278
|
+
* @param {Module} module module
|
279
|
+
*/
|
249
280
|
const optimizeIncomingConnections = module => {
|
250
281
|
if (optimizedModules.has(module)) return;
|
251
282
|
optimizedModules.add(module);
|
@@ -52,7 +52,7 @@ const MinMaxSizeWarning = require("./MinMaxSizeWarning");
|
|
52
52
|
*/
|
53
53
|
|
54
54
|
/**
|
55
|
-
* @typedef {
|
55
|
+
* @typedef {object} CacheGroupSource
|
56
56
|
* @property {string=} key
|
57
57
|
* @property {number=} priority
|
58
58
|
* @property {GetName=} getName
|
@@ -75,7 +75,7 @@ const MinMaxSizeWarning = require("./MinMaxSizeWarning");
|
|
75
75
|
*/
|
76
76
|
|
77
77
|
/**
|
78
|
-
* @typedef {
|
78
|
+
* @typedef {object} CacheGroup
|
79
79
|
* @property {string} key
|
80
80
|
* @property {number=} priority
|
81
81
|
* @property {GetName=} getName
|
@@ -101,7 +101,7 @@ const MinMaxSizeWarning = require("./MinMaxSizeWarning");
|
|
101
101
|
*/
|
102
102
|
|
103
103
|
/**
|
104
|
-
* @typedef {
|
104
|
+
* @typedef {object} FallbackCacheGroup
|
105
105
|
* @property {ChunkFilterFunction} chunksFilter
|
106
106
|
* @property {SplitChunksSizes} minSize
|
107
107
|
* @property {SplitChunksSizes} maxAsyncSize
|
@@ -110,7 +110,7 @@ const MinMaxSizeWarning = require("./MinMaxSizeWarning");
|
|
110
110
|
*/
|
111
111
|
|
112
112
|
/**
|
113
|
-
* @typedef {
|
113
|
+
* @typedef {object} CacheGroupsContext
|
114
114
|
* @property {ModuleGraph} moduleGraph
|
115
115
|
* @property {ChunkGraph} chunkGraph
|
116
116
|
*/
|
@@ -131,7 +131,7 @@ const MinMaxSizeWarning = require("./MinMaxSizeWarning");
|
|
131
131
|
*/
|
132
132
|
|
133
133
|
/**
|
134
|
-
* @typedef {
|
134
|
+
* @typedef {object} SplitChunksOptions
|
135
135
|
* @property {ChunkFilterFunction} chunksFilter
|
136
136
|
* @property {string[]} defaultSizeTypes
|
137
137
|
* @property {SplitChunksSizes} minSize
|
@@ -153,14 +153,14 @@ const MinMaxSizeWarning = require("./MinMaxSizeWarning");
|
|
153
153
|
*/
|
154
154
|
|
155
155
|
/**
|
156
|
-
* @typedef {
|
156
|
+
* @typedef {object} ChunksInfoItem
|
157
157
|
* @property {SortableSet<Module>} modules
|
158
158
|
* @property {CacheGroup} cacheGroup
|
159
159
|
* @property {number} cacheGroupIndex
|
160
160
|
* @property {string} name
|
161
161
|
* @property {Record<string, number>} sizes
|
162
162
|
* @property {Set<Chunk>} chunks
|
163
|
-
* @property {Set<Chunk>}
|
163
|
+
* @property {Set<Chunk>} reusableChunks
|
164
164
|
* @property {Set<bigint | Chunk>} chunksKeys
|
165
165
|
*/
|
166
166
|
|
@@ -1023,7 +1023,7 @@ module.exports = class SplitChunksPlugin {
|
|
1023
1023
|
getExportsCombinationsFactory()(key);
|
1024
1024
|
|
1025
1025
|
/**
|
1026
|
-
* @typedef {
|
1026
|
+
* @typedef {object} SelectedChunksResult
|
1027
1027
|
* @property {Chunk[]} chunks the list of chunks
|
1028
1028
|
* @property {bigint | Chunk} key a key of the list
|
1029
1029
|
*/
|
@@ -1177,7 +1177,7 @@ module.exports = class SplitChunksPlugin {
|
|
1177
1177
|
name,
|
1178
1178
|
sizes: {},
|
1179
1179
|
chunks: new Set(),
|
1180
|
-
|
1180
|
+
reusableChunks: new Set(),
|
1181
1181
|
chunksKeys: new Set()
|
1182
1182
|
})
|
1183
1183
|
);
|
@@ -1322,7 +1322,7 @@ module.exports = class SplitChunksPlugin {
|
|
1322
1322
|
}
|
1323
1323
|
|
1324
1324
|
/**
|
1325
|
-
* @typedef {
|
1325
|
+
* @typedef {object} MaxSizeQueueItem
|
1326
1326
|
* @property {SplitChunksSizes} minSize
|
1327
1327
|
* @property {SplitChunksSizes} maxAsyncSize
|
1328
1328
|
* @property {SplitChunksSizes} maxInitialSize
|
@@ -13,18 +13,19 @@ const NoAsyncChunksWarning = require("./NoAsyncChunksWarning");
|
|
13
13
|
/** @typedef {import("webpack-sources").Source} Source */
|
14
14
|
/** @typedef {import("../../declarations/WebpackOptions").PerformanceOptions} PerformanceOptions */
|
15
15
|
/** @typedef {import("../ChunkGroup")} ChunkGroup */
|
16
|
+
/** @typedef {import("../Compilation").Asset} Asset */
|
16
17
|
/** @typedef {import("../Compiler")} Compiler */
|
17
18
|
/** @typedef {import("../Entrypoint")} Entrypoint */
|
18
19
|
/** @typedef {import("../WebpackError")} WebpackError */
|
19
20
|
|
20
21
|
/**
|
21
|
-
* @typedef {
|
22
|
+
* @typedef {object} AssetDetails
|
22
23
|
* @property {string} name
|
23
24
|
* @property {number} size
|
24
25
|
*/
|
25
26
|
|
26
27
|
/**
|
27
|
-
* @typedef {
|
28
|
+
* @typedef {object} EntrypointDetails
|
28
29
|
* @property {string} name
|
29
30
|
* @property {number} size
|
30
31
|
* @property {string[]} files
|
@@ -32,6 +33,12 @@ const NoAsyncChunksWarning = require("./NoAsyncChunksWarning");
|
|
32
33
|
|
33
34
|
const isOverSizeLimitSet = new WeakSet();
|
34
35
|
|
36
|
+
/**
|
37
|
+
* @param {Asset["name"]} name the name
|
38
|
+
* @param {Asset["source"]} source the source
|
39
|
+
* @param {Asset["info"]} info the info
|
40
|
+
* @returns {boolean} result
|
41
|
+
*/
|
35
42
|
const excludeSourceMap = (name, source, info) => !info.development;
|
36
43
|
|
37
44
|
module.exports = class SizeLimitsPlugin {
|
@@ -104,6 +111,10 @@ module.exports = class SizeLimitsPlugin {
|
|
104
111
|
}
|
105
112
|
}
|
106
113
|
|
114
|
+
/**
|
115
|
+
* @param {Asset["name"]} name the name
|
116
|
+
* @returns {boolean | undefined} result
|
117
|
+
*/
|
107
118
|
const fileFilter = name => {
|
108
119
|
const asset = compilation.getAsset(name);
|
109
120
|
return asset && assetFilter(asset.name, asset.source, asset.info);
|
@@ -7,11 +7,18 @@
|
|
7
7
|
|
8
8
|
/** @typedef {import("./RuleSetCompiler")} RuleSetCompiler */
|
9
9
|
/** @typedef {import("./RuleSetCompiler").RuleCondition} RuleCondition */
|
10
|
+
/** @typedef {import("./RuleSetCompiler").RuleConditionFunction} RuleConditionFunction */
|
10
11
|
|
11
12
|
class ObjectMatcherRulePlugin {
|
12
|
-
|
13
|
+
/**
|
14
|
+
* @param {string} ruleProperty the rule property
|
15
|
+
* @param {string=} dataProperty the data property
|
16
|
+
* @param {RuleConditionFunction=} additionalConditionFunction need to check
|
17
|
+
*/
|
18
|
+
constructor(ruleProperty, dataProperty, additionalConditionFunction) {
|
13
19
|
this.ruleProperty = ruleProperty;
|
14
20
|
this.dataProperty = dataProperty || ruleProperty;
|
21
|
+
this.additionalConditionFunction = additionalConditionFunction;
|
15
22
|
}
|
16
23
|
|
17
24
|
/**
|
@@ -32,6 +39,13 @@ class ObjectMatcherRulePlugin {
|
|
32
39
|
`${path}.${ruleProperty}.${property}`,
|
33
40
|
value[property]
|
34
41
|
);
|
42
|
+
if (this.additionalConditionFunction) {
|
43
|
+
result.conditions.push({
|
44
|
+
property: [dataProperty],
|
45
|
+
matchWhenEmpty: condition.matchWhenEmpty,
|
46
|
+
fn: this.additionalConditionFunction
|
47
|
+
});
|
48
|
+
}
|
35
49
|
result.conditions.push({
|
36
50
|
property: [dataProperty, ...nestedDataProperties],
|
37
51
|
matchWhenEmpty: condition.matchWhenEmpty,
|
@@ -7,21 +7,23 @@
|
|
7
7
|
|
8
8
|
const { SyncHook } = require("tapable");
|
9
9
|
|
10
|
+
/** @typedef {function(string): boolean} RuleConditionFunction */
|
11
|
+
|
10
12
|
/**
|
11
|
-
* @typedef {
|
13
|
+
* @typedef {object} RuleCondition
|
12
14
|
* @property {string | string[]} property
|
13
15
|
* @property {boolean} matchWhenEmpty
|
14
|
-
* @property {
|
16
|
+
* @property {RuleConditionFunction} fn
|
15
17
|
*/
|
16
18
|
|
17
19
|
/**
|
18
|
-
* @typedef {
|
20
|
+
* @typedef {object} Condition
|
19
21
|
* @property {boolean} matchWhenEmpty
|
20
|
-
* @property {
|
22
|
+
* @property {RuleConditionFunction} fn
|
21
23
|
*/
|
22
24
|
|
23
25
|
/**
|
24
|
-
* @typedef {
|
26
|
+
* @typedef {object} CompiledRule
|
25
27
|
* @property {RuleCondition[]} conditions
|
26
28
|
* @property {(Effect|function(object): Effect[])[]} effects
|
27
29
|
* @property {CompiledRule[]=} rules
|
@@ -29,13 +31,13 @@ const { SyncHook } = require("tapable");
|
|
29
31
|
*/
|
30
32
|
|
31
33
|
/**
|
32
|
-
* @typedef {
|
34
|
+
* @typedef {object} Effect
|
33
35
|
* @property {string} type
|
34
36
|
* @property {any} value
|
35
37
|
*/
|
36
38
|
|
37
39
|
/**
|
38
|
-
* @typedef {
|
40
|
+
* @typedef {object} RuleSet
|
39
41
|
* @property {Map<string, any>} references map of references in the rule set (may grow over time)
|
40
42
|
* @property {function(object): Effect[]} exec execute the rule set
|
41
43
|
*/
|
@@ -9,10 +9,11 @@ const RuntimeModule = require("../RuntimeModule");
|
|
9
9
|
const Template = require("../Template");
|
10
10
|
|
11
11
|
/** @typedef {import("../Compilation")} Compilation */
|
12
|
+
/** @typedef {import("../Module").ReadOnlyRuntimeRequirements} ReadOnlyRuntimeRequirements */
|
12
13
|
|
13
14
|
class EnsureChunkRuntimeModule extends RuntimeModule {
|
14
15
|
/**
|
15
|
-
* @param {
|
16
|
+
* @param {ReadOnlyRuntimeRequirements} runtimeRequirements runtime requirements
|
16
17
|
*/
|
17
18
|
constructor(runtimeRequirements) {
|
18
19
|
super("ensure chunk");
|