webpack 5.90.2 → 5.91.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 +5 -1
- package/lib/APIPlugin.js +8 -4
- package/lib/AutomaticPrefetchPlugin.js +1 -1
- package/lib/BannerPlugin.js +3 -1
- package/lib/Cache.js +7 -1
- package/lib/CacheFacade.js +3 -3
- package/lib/ChunkGraph.js +32 -18
- package/lib/ChunkGroup.js +14 -14
- package/lib/CleanPlugin.js +7 -5
- package/lib/Compilation.js +263 -94
- package/lib/Compiler.js +199 -83
- package/lib/ConditionalInitFragment.js +4 -5
- package/lib/ContextModule.js +4 -1
- package/lib/ContextModuleFactory.js +4 -2
- package/lib/ContextReplacementPlugin.js +3 -2
- package/lib/CssModule.js +0 -3
- package/lib/DefinePlugin.js +4 -2
- package/lib/DelegatedModule.js +2 -1
- package/lib/Dependency.js +4 -2
- package/lib/DependencyTemplate.js +7 -2
- package/lib/DllModule.js +3 -1
- package/lib/DllReferencePlugin.js +6 -2
- package/lib/EntryOptionPlugin.js +4 -1
- package/lib/EntryPlugin.js +6 -1
- package/lib/Entrypoint.js +1 -1
- package/lib/ExportsInfo.js +1 -4
- package/lib/ExternalModule.js +120 -25
- package/lib/ExternalModuleFactoryPlugin.js +37 -2
- package/lib/FileSystemInfo.js +1 -1
- package/lib/Generator.js +2 -1
- package/lib/HookWebpackError.js +2 -2
- package/lib/InitFragment.js +5 -3
- package/lib/LibManifestPlugin.js +15 -7
- package/lib/Module.js +54 -5
- package/lib/ModuleFilenameHelpers.js +1 -1
- package/lib/ModuleGraph.js +56 -27
- package/lib/ModuleGraphConnection.js +2 -1
- package/lib/MultiCompiler.js +61 -17
- package/lib/NodeStuffPlugin.js +14 -3
- package/lib/NormalModule.js +239 -86
- package/lib/NormalModuleFactory.js +163 -32
- package/lib/NormalModuleReplacementPlugin.js +5 -1
- package/lib/ProvidePlugin.js +3 -1
- package/lib/RawModule.js +4 -2
- package/lib/ResolverFactory.js +5 -1
- package/lib/RuntimeModule.js +6 -5
- package/lib/RuntimePlugin.js +1 -0
- package/lib/RuntimeTemplate.js +102 -34
- package/lib/SourceMapDevToolPlugin.js +4 -1
- package/lib/Stats.js +12 -5
- package/lib/TemplatedPathPlugin.js +32 -6
- package/lib/Watching.js +67 -60
- package/lib/WebpackError.js +6 -6
- package/lib/WebpackOptionsApply.js +18 -5
- package/lib/asset/RawDataUrlModule.js +5 -2
- package/lib/async-modules/AwaitDependenciesInitFragment.js +2 -2
- package/lib/buildChunkGraph.js +220 -392
- 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 +49 -16
- package/lib/cache/ResolverCachePlugin.js +14 -6
- package/lib/cache/getLazyHashedEtag.js +1 -1
- package/lib/config/defaults.js +24 -1
- package/lib/config/normalization.js +3 -1
- package/lib/container/ContainerEntryDependency.js +2 -1
- package/lib/container/ContainerEntryModule.js +5 -2
- package/lib/container/ContainerPlugin.js +14 -10
- package/lib/container/FallbackModule.js +3 -2
- package/lib/container/RemoteModule.js +2 -1
- package/lib/container/RemoteRuntimeModule.js +12 -3
- package/lib/css/CssExportsGenerator.js +34 -17
- package/lib/css/CssGenerator.js +20 -2
- package/lib/css/CssLoadingRuntimeModule.js +212 -96
- package/lib/css/CssModulesPlugin.js +47 -13
- package/lib/debug/ProfilingPlugin.js +27 -2
- 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/CssLocalIdentifierDependency.js +63 -8
- package/lib/dependencies/CssUrlDependency.js +5 -3
- package/lib/dependencies/ExportsInfoDependency.js +4 -3
- 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 +44 -16
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +7 -6
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +21 -10
- 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/ImportParserPlugin.js +12 -4
- package/lib/dependencies/ImportWeakDependency.js +4 -2
- package/lib/dependencies/LoaderDependency.js +2 -1
- package/lib/dependencies/LoaderImportDependency.js +2 -1
- package/lib/dependencies/ModuleDependency.js +4 -5
- package/lib/dependencies/PureExpressionDependency.js +4 -1
- 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 +6 -5
- package/lib/dependencies/getFunctionExpression.js +3 -1
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +2 -1
- package/lib/hmr/LazyCompilationPlugin.js +2 -1
- package/lib/javascript/BasicEvaluatedExpression.js +2 -2
- package/lib/javascript/ChunkHelpers.js +2 -2
- package/lib/javascript/JavascriptParser.js +169 -57
- package/lib/javascript/JavascriptParserHelpers.js +1 -1
- package/lib/javascript/StartupHelpers.js +22 -5
- package/lib/logging/Logger.js +27 -2
- package/lib/logging/createConsoleLogger.js +11 -7
- package/lib/node/NodeEnvironmentPlugin.js +13 -7
- package/lib/node/NodeWatchFileSystem.js +37 -26
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -1
- package/lib/node/RequireChunkLoadingRuntimeModule.js +2 -1
- package/lib/node/nodeConsole.js +24 -1
- package/lib/optimize/AggressiveSplittingPlugin.js +1 -0
- package/lib/optimize/ConcatenatedModule.js +140 -55
- package/lib/optimize/EnsureChunkConditionsPlugin.js +1 -1
- package/lib/optimize/InnerGraph.js +7 -2
- package/lib/optimize/InnerGraphPlugin.js +36 -13
- package/lib/optimize/ModuleConcatenationPlugin.js +12 -2
- package/lib/optimize/RemoveParentModulesPlugin.js +1 -0
- package/lib/optimize/RuntimeChunkPlugin.js +6 -1
- package/lib/optimize/SideEffectsFlagPlugin.js +46 -15
- package/lib/optimize/SplitChunksPlugin.js +2 -2
- package/lib/performance/SizeLimitsPlugin.js +11 -0
- package/lib/rules/ObjectMatcherRulePlugin.js +4 -0
- package/lib/runtime/EnsureChunkRuntimeModule.js +2 -1
- package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +2 -1
- package/lib/serialization/FileMiddleware.js +1 -0
- package/lib/serialization/ObjectMiddleware.js +2 -0
- package/lib/serialization/Serializer.js +19 -0
- package/lib/sharing/ConsumeSharedModule.js +3 -2
- package/lib/sharing/ConsumeSharedPlugin.js +17 -3
- package/lib/sharing/ConsumeSharedRuntimeModule.js +9 -2
- package/lib/sharing/ProvideSharedModule.js +2 -1
- package/lib/sharing/ProvideSharedPlugin.js +12 -5
- package/lib/sharing/resolveMatchedConfigs.js +2 -2
- package/lib/sharing/utils.js +13 -6
- package/lib/util/StackedCacheMap.js +26 -0
- package/lib/util/WeakTupleMap.js +57 -13
- package/lib/util/cleverMerge.js +24 -11
- package/lib/util/comparators.js +34 -14
- package/lib/util/conventions.js +129 -0
- package/lib/util/fs.js +379 -65
- package/lib/util/hash/BatchedHash.js +3 -0
- package/lib/util/hash/xxhash64.js +2 -2
- package/lib/util/memoize.js +2 -0
- package/lib/util/runtime.js +1 -1
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +4 -2
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +15 -6
- package/lib/wasm-sync/WebAssemblyGenerator.js +27 -6
- package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +2 -1
- package/lib/wasm-sync/WebAssemblyParser.js +7 -4
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +2 -1
- package/lib/webpack.js +11 -5
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +2 -1
- package/package.json +25 -26
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +69 -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 +1772 -673
package/lib/NormalModule.js
CHANGED
@@ -49,7 +49,6 @@ const makeSerializable = require("./util/makeSerializable");
|
|
49
49
|
const memoize = require("./util/memoize");
|
50
50
|
|
51
51
|
/** @typedef {import("webpack-sources").Source} Source */
|
52
|
-
/** @typedef {import("../declarations/LoaderContext").NormalModuleLoaderContext} NormalModuleLoaderContext */
|
53
52
|
/** @typedef {import("../declarations/WebpackOptions").Mode} Mode */
|
54
53
|
/** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */
|
55
54
|
/** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */
|
@@ -58,17 +57,23 @@ const memoize = require("./util/memoize");
|
|
58
57
|
/** @typedef {import("./Dependency").UpdateHashContext} UpdateHashContext */
|
59
58
|
/** @typedef {import("./DependencyTemplates")} DependencyTemplates */
|
60
59
|
/** @typedef {import("./Generator")} Generator */
|
60
|
+
/** @typedef {import("./Module").BuildInfo} BuildInfo */
|
61
|
+
/** @typedef {import("./Module").BuildMeta} BuildMeta */
|
61
62
|
/** @typedef {import("./Module").CodeGenerationContext} CodeGenerationContext */
|
62
63
|
/** @typedef {import("./Module").CodeGenerationResult} CodeGenerationResult */
|
63
64
|
/** @typedef {import("./Module").ConcatenationBailoutReasonContext} ConcatenationBailoutReasonContext */
|
65
|
+
/** @typedef {import("./Module").KnownBuildInfo} KnownBuildInfo */
|
64
66
|
/** @typedef {import("./Module").LibIdentOptions} LibIdentOptions */
|
65
67
|
/** @typedef {import("./Module").NeedBuildContext} NeedBuildContext */
|
68
|
+
/** @typedef {import("./Module").SourceTypes} SourceTypes */
|
69
|
+
/** @typedef {import("./Module").UnsafeCacheData} UnsafeCacheData */
|
66
70
|
/** @typedef {import("./ModuleGraph")} ModuleGraph */
|
67
71
|
/** @typedef {import("./ModuleGraphConnection").ConnectionState} ConnectionState */
|
68
72
|
/** @typedef {import("./ModuleTypeConstants").JavaScriptModuleTypes} JavaScriptModuleTypes */
|
69
73
|
/** @typedef {import("./NormalModuleFactory")} NormalModuleFactory */
|
70
74
|
/** @typedef {import("./Parser")} Parser */
|
71
75
|
/** @typedef {import("./RequestShortener")} RequestShortener */
|
76
|
+
/** @typedef {import("./ResolverFactory").ResolveContext} ResolveContext */
|
72
77
|
/** @typedef {import("./ResolverFactory").ResolverWithOptions} ResolverWithOptions */
|
73
78
|
/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */
|
74
79
|
/** @typedef {import("./logging/Logger").Logger} WebpackLogger */
|
@@ -78,6 +83,11 @@ const memoize = require("./util/memoize");
|
|
78
83
|
/** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */
|
79
84
|
/** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */
|
80
85
|
|
86
|
+
/** @typedef {{[k: string]: any}} ParserOptions */
|
87
|
+
/** @typedef {{[k: string]: any}} GeneratorOptions */
|
88
|
+
|
89
|
+
/** @typedef {UnsafeCacheData & { parser: undefined | Parser, parserOptions: undefined | ParserOptions, generator: undefined | Generator, generatorOptions: undefined | GeneratorOptions }} NormalModuleUnsafeCacheData */
|
90
|
+
|
81
91
|
/**
|
82
92
|
* @typedef {Object} SourceMap
|
83
93
|
* @property {number} version
|
@@ -212,9 +222,9 @@ makeSerializable(
|
|
212
222
|
* @property {string} context context directory for resolving
|
213
223
|
* @property {string=} matchResource path + query of the matched resource (virtual)
|
214
224
|
* @property {Parser} parser the parser used
|
215
|
-
* @property {
|
225
|
+
* @property {ParserOptions=} parserOptions the options of the parser used
|
216
226
|
* @property {Generator} generator the generator used
|
217
|
-
* @property {
|
227
|
+
* @property {GeneratorOptions=} generatorOptions the options of the generator used
|
218
228
|
* @property {ResolveOptions=} resolveOptions options used for resolving requests from this module
|
219
229
|
*/
|
220
230
|
|
@@ -264,9 +274,12 @@ class NormalModule extends Module {
|
|
264
274
|
),
|
265
275
|
needBuild: new AsyncSeriesBailHook(["module", "context"])
|
266
276
|
};
|
267
|
-
compilationHooksMap.set(
|
277
|
+
compilationHooksMap.set(
|
278
|
+
compilation,
|
279
|
+
/** @type {NormalModuleCompilationHooks} */ (hooks)
|
280
|
+
);
|
268
281
|
}
|
269
|
-
return hooks;
|
282
|
+
return /** @type {NormalModuleCompilationHooks} */ (hooks);
|
270
283
|
}
|
271
284
|
|
272
285
|
/**
|
@@ -300,11 +313,13 @@ class NormalModule extends Module {
|
|
300
313
|
this.rawRequest = rawRequest;
|
301
314
|
/** @type {boolean} */
|
302
315
|
this.binary = /^(asset|webassembly)\b/.test(type);
|
303
|
-
/** @type {Parser} */
|
316
|
+
/** @type {undefined | Parser} */
|
304
317
|
this.parser = parser;
|
318
|
+
/** @type {undefined | ParserOptions} */
|
305
319
|
this.parserOptions = parserOptions;
|
306
|
-
/** @type {Generator} */
|
320
|
+
/** @type {undefined | Generator} */
|
307
321
|
this.generator = generator;
|
322
|
+
/** @type {undefined | GeneratorOptions} */
|
308
323
|
this.generatorOptions = generatorOptions;
|
309
324
|
/** @type {string} */
|
310
325
|
this.resource = resource;
|
@@ -319,13 +334,22 @@ class NormalModule extends Module {
|
|
319
334
|
}
|
320
335
|
|
321
336
|
// Info from Build
|
322
|
-
/** @type {
|
337
|
+
/** @type {WebpackError | null} */
|
323
338
|
this.error = null;
|
324
|
-
/**
|
339
|
+
/**
|
340
|
+
* @private
|
341
|
+
* @type {Source | null}
|
342
|
+
*/
|
325
343
|
this._source = null;
|
326
|
-
/**
|
344
|
+
/**
|
345
|
+
* @private
|
346
|
+
* @type {Map<string, number> | undefined}
|
347
|
+
**/
|
327
348
|
this._sourceSizes = undefined;
|
328
|
-
/**
|
349
|
+
/**
|
350
|
+
* @private
|
351
|
+
* @type {undefined | SourceTypes}
|
352
|
+
**/
|
329
353
|
this._sourceTypes = undefined;
|
330
354
|
|
331
355
|
// Cache
|
@@ -419,7 +443,7 @@ class NormalModule extends Module {
|
|
419
443
|
// TODO reconsider this for webpack 6
|
420
444
|
if (this.buildInfo) {
|
421
445
|
if (this._sourceTypes === undefined) this.getSourceTypes();
|
422
|
-
for (const type of this._sourceTypes) {
|
446
|
+
for (const type of /** @type {SourceTypes} */ (this._sourceTypes)) {
|
423
447
|
this.size(type);
|
424
448
|
}
|
425
449
|
}
|
@@ -433,15 +457,22 @@ class NormalModule extends Module {
|
|
433
457
|
/**
|
434
458
|
* Module should be unsafe cached. Get data that's needed for that.
|
435
459
|
* This data will be passed to restoreFromUnsafeCache later.
|
436
|
-
* @returns {
|
460
|
+
* @returns {UnsafeCacheData} cached data
|
437
461
|
*/
|
438
462
|
getUnsafeCacheData() {
|
439
|
-
const data =
|
463
|
+
const data =
|
464
|
+
/** @type {NormalModuleUnsafeCacheData} */
|
465
|
+
(super.getUnsafeCacheData());
|
440
466
|
data.parserOptions = this.parserOptions;
|
441
467
|
data.generatorOptions = this.generatorOptions;
|
442
468
|
return data;
|
443
469
|
}
|
444
470
|
|
471
|
+
/**
|
472
|
+
* restore unsafe cache data
|
473
|
+
* @param {NormalModuleUnsafeCacheData} unsafeCacheData data from getUnsafeCacheData
|
474
|
+
* @param {NormalModuleFactory} normalModuleFactory the normal module factory handling the unsafe caching
|
475
|
+
*/
|
445
476
|
restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory) {
|
446
477
|
this._restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory);
|
447
478
|
}
|
@@ -466,8 +497,8 @@ class NormalModule extends Module {
|
|
466
497
|
/**
|
467
498
|
* @param {string} context the compilation context
|
468
499
|
* @param {string} name the asset name
|
469
|
-
* @param {string} content the content
|
470
|
-
* @param {string |
|
500
|
+
* @param {string | Buffer} content the content
|
501
|
+
* @param {(string | SourceMap)=} sourceMap an optional source map
|
471
502
|
* @param {Object=} associatedObjectForCache object for caching
|
472
503
|
* @returns {Source} the created source
|
473
504
|
*/
|
@@ -493,7 +524,11 @@ class NormalModule extends Module {
|
|
493
524
|
return new SourceMapSource(
|
494
525
|
content,
|
495
526
|
name,
|
496
|
-
contextifySourceMap(
|
527
|
+
contextifySourceMap(
|
528
|
+
context,
|
529
|
+
/** @type {SourceMap} */ (sourceMap),
|
530
|
+
associatedObjectForCache
|
531
|
+
)
|
497
532
|
);
|
498
533
|
}
|
499
534
|
}
|
@@ -502,12 +537,14 @@ class NormalModule extends Module {
|
|
502
537
|
}
|
503
538
|
|
504
539
|
/**
|
540
|
+
* @private
|
541
|
+
* @template T
|
505
542
|
* @param {ResolverWithOptions} resolver a resolver
|
506
543
|
* @param {WebpackOptions} options webpack options
|
507
544
|
* @param {Compilation} compilation the compilation
|
508
545
|
* @param {InputFileSystem} fs file system from reading
|
509
546
|
* @param {NormalModuleCompilationHooks} hooks the hooks
|
510
|
-
* @returns {NormalModuleLoaderContext} loader context
|
547
|
+
* @returns {import("../declarations/LoaderContext").NormalModuleLoaderContext<T>} loader context
|
511
548
|
*/
|
512
549
|
_createLoaderContext(resolver, options, compilation, fs, hooks) {
|
513
550
|
const { requestShortener } = compilation.runtimeTemplate;
|
@@ -516,16 +553,19 @@ class NormalModule extends Module {
|
|
516
553
|
if (!currentLoader) return "(not in loader scope)";
|
517
554
|
return requestShortener.shorten(currentLoader.loader);
|
518
555
|
};
|
556
|
+
/**
|
557
|
+
* @returns {ResolveContext} resolve context
|
558
|
+
*/
|
519
559
|
const getResolveContext = () => {
|
520
560
|
return {
|
521
561
|
fileDependencies: {
|
522
|
-
add: d => loaderContext.addDependency(d)
|
562
|
+
add: d => /** @type {TODO} */ (loaderContext).addDependency(d)
|
523
563
|
},
|
524
564
|
contextDependencies: {
|
525
|
-
add: d => loaderContext.addContextDependency(d)
|
565
|
+
add: d => /** @type {TODO} */ (loaderContext).addContextDependency(d)
|
526
566
|
},
|
527
567
|
missingDependencies: {
|
528
|
-
add: d => loaderContext.addMissingDependency(d)
|
568
|
+
add: d => /** @type {TODO} */ (loaderContext).addMissingDependency(d)
|
529
569
|
}
|
530
570
|
};
|
531
571
|
};
|
@@ -542,26 +582,41 @@ class NormalModule extends Module {
|
|
542
582
|
contextify.bindContextCache(this.context, compilation.compiler.root)
|
543
583
|
);
|
544
584
|
const utils = {
|
585
|
+
/**
|
586
|
+
* @param {string} context context
|
587
|
+
* @param {string} request request
|
588
|
+
* @returns {string} result
|
589
|
+
*/
|
545
590
|
absolutify: (context, request) => {
|
546
591
|
return context === this.context
|
547
592
|
? getAbsolutifyInContext()(request)
|
548
593
|
: getAbsolutify()(context, request);
|
549
594
|
},
|
595
|
+
/**
|
596
|
+
* @param {string} context context
|
597
|
+
* @param {string} request request
|
598
|
+
* @returns {string} result
|
599
|
+
*/
|
550
600
|
contextify: (context, request) => {
|
551
601
|
return context === this.context
|
552
602
|
? getContextifyInContext()(request)
|
553
603
|
: getContextify()(context, request);
|
554
604
|
},
|
605
|
+
/**
|
606
|
+
* @param {(string | typeof import("./util/Hash"))=} type type
|
607
|
+
* @returns {Hash} hash
|
608
|
+
*/
|
555
609
|
createHash: type => {
|
556
610
|
return createHash(type || compilation.outputOptions.hashFunction);
|
557
611
|
}
|
558
612
|
};
|
613
|
+
/** @type {import("../declarations/LoaderContext").NormalModuleLoaderContext<T>} */
|
559
614
|
const loaderContext = {
|
560
615
|
version: 2,
|
561
616
|
getOptions: schema => {
|
562
617
|
const loader = this.getCurrentLoader(loaderContext);
|
563
618
|
|
564
|
-
let { options } = loader;
|
619
|
+
let { options } = /** @type {LoaderItem} */ (loader);
|
565
620
|
|
566
621
|
if (typeof options === "string") {
|
567
622
|
if (options.startsWith("{") && options.endsWith("}")) {
|
@@ -649,27 +704,39 @@ class NormalModule extends Module {
|
|
649
704
|
};
|
650
705
|
},
|
651
706
|
emitFile: (name, content, sourceMap, assetInfo) => {
|
652
|
-
|
653
|
-
|
654
|
-
|
707
|
+
const buildInfo = /** @type {BuildInfo} */ (this.buildInfo);
|
708
|
+
|
709
|
+
if (!buildInfo.assets) {
|
710
|
+
buildInfo.assets = Object.create(null);
|
711
|
+
buildInfo.assetsInfo = new Map();
|
655
712
|
}
|
656
|
-
|
657
|
-
|
713
|
+
|
714
|
+
const assets =
|
715
|
+
/** @type {NonNullable<KnownBuildInfo["assets"]>} */
|
716
|
+
(buildInfo.assets);
|
717
|
+
const assetsInfo =
|
718
|
+
/** @type {NonNullable<KnownBuildInfo["assetsInfo"]>} */
|
719
|
+
(buildInfo.assetsInfo);
|
720
|
+
|
721
|
+
assets[name] = this.createSourceForAsset(
|
722
|
+
/** @type {string} */ (options.context),
|
658
723
|
name,
|
659
724
|
content,
|
660
725
|
sourceMap,
|
661
726
|
compilation.compiler.root
|
662
727
|
);
|
663
|
-
|
728
|
+
assetsInfo.set(name, assetInfo);
|
664
729
|
},
|
665
730
|
addBuildDependency: dep => {
|
666
|
-
|
667
|
-
|
731
|
+
const buildInfo = /** @type {BuildInfo} */ (this.buildInfo);
|
732
|
+
|
733
|
+
if (buildInfo.buildDependencies === undefined) {
|
734
|
+
buildInfo.buildDependencies = new LazySet();
|
668
735
|
}
|
669
|
-
|
736
|
+
buildInfo.buildDependencies.add(dep);
|
670
737
|
},
|
671
738
|
utils,
|
672
|
-
rootContext: options.context,
|
739
|
+
rootContext: /** @type {string} */ (options.context),
|
673
740
|
webpack: true,
|
674
741
|
sourceMap: !!this.useSourceMap,
|
675
742
|
mode: options.mode || "production",
|
@@ -686,6 +753,12 @@ class NormalModule extends Module {
|
|
686
753
|
return loaderContext;
|
687
754
|
}
|
688
755
|
|
756
|
+
// TODO remove `loaderContext` in webpack@6
|
757
|
+
/**
|
758
|
+
* @param {TODO} loaderContext loader context
|
759
|
+
* @param {number} index index
|
760
|
+
* @returns {LoaderItem | null} loader
|
761
|
+
*/
|
689
762
|
getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) {
|
690
763
|
if (
|
691
764
|
this.loaders &&
|
@@ -702,7 +775,7 @@ class NormalModule extends Module {
|
|
702
775
|
/**
|
703
776
|
* @param {string} context the compilation context
|
704
777
|
* @param {string | Buffer} content the content
|
705
|
-
* @param {string |
|
778
|
+
* @param {(string | SourceMapSource)=} sourceMap an optional source map
|
706
779
|
* @param {Object=} associatedObjectForCache object for caching
|
707
780
|
* @returns {Source} the created source
|
708
781
|
*/
|
@@ -723,7 +796,11 @@ class NormalModule extends Module {
|
|
723
796
|
return new SourceMapSource(
|
724
797
|
content,
|
725
798
|
contextifySourceUrl(context, identifier, associatedObjectForCache),
|
726
|
-
contextifySourceMap(
|
799
|
+
contextifySourceMap(
|
800
|
+
context,
|
801
|
+
/** @type {TODO} */ (sourceMap),
|
802
|
+
associatedObjectForCache
|
803
|
+
)
|
727
804
|
);
|
728
805
|
}
|
729
806
|
|
@@ -791,7 +868,7 @@ class NormalModule extends Module {
|
|
791
868
|
}
|
792
869
|
|
793
870
|
this._source = this.createSource(
|
794
|
-
options.context,
|
871
|
+
/** @type {string} */ (options.context),
|
795
872
|
this.binary ? asBuffer(source) : asString(source),
|
796
873
|
sourceMap,
|
797
874
|
compilation.compiler.root
|
@@ -806,10 +883,12 @@ class NormalModule extends Module {
|
|
806
883
|
return callback();
|
807
884
|
};
|
808
885
|
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
886
|
+
const buildInfo = /** @type {BuildInfo} */ (this.buildInfo);
|
887
|
+
|
888
|
+
buildInfo.fileDependencies = new LazySet();
|
889
|
+
buildInfo.contextDependencies = new LazySet();
|
890
|
+
buildInfo.missingDependencies = new LazySet();
|
891
|
+
buildInfo.cacheable = true;
|
813
892
|
|
814
893
|
try {
|
815
894
|
hooks.beforeLoaders.call(this.loaders, this, loaderContext);
|
@@ -819,7 +898,8 @@ class NormalModule extends Module {
|
|
819
898
|
}
|
820
899
|
|
821
900
|
if (this.loaders.length > 0) {
|
822
|
-
|
901
|
+
/** @type {BuildInfo} */
|
902
|
+
(this.buildInfo).buildDependencies = new LazySet();
|
823
903
|
}
|
824
904
|
|
825
905
|
runLoaders(
|
@@ -846,23 +926,43 @@ class NormalModule extends Module {
|
|
846
926
|
loaderContext._compilation =
|
847
927
|
loaderContext._compiler =
|
848
928
|
loaderContext._module =
|
929
|
+
// eslint-disable-next-line no-warning-comments
|
930
|
+
// @ts-ignore
|
849
931
|
loaderContext.fs =
|
850
932
|
undefined;
|
851
933
|
|
852
934
|
if (!result) {
|
853
|
-
|
935
|
+
/** @type {BuildInfo} */
|
936
|
+
(this.buildInfo).cacheable = false;
|
854
937
|
return processResult(
|
855
938
|
err || new Error("No result from loader-runner processing"),
|
856
939
|
null
|
857
940
|
);
|
858
941
|
}
|
859
|
-
|
860
|
-
this.buildInfo
|
861
|
-
|
942
|
+
|
943
|
+
const buildInfo = /** @type {BuildInfo} */ (this.buildInfo);
|
944
|
+
|
945
|
+
const fileDependencies =
|
946
|
+
/** @type {NonNullable<KnownBuildInfo["fileDependencies"]>} */
|
947
|
+
(buildInfo.fileDependencies);
|
948
|
+
const contextDependencies =
|
949
|
+
/** @type {NonNullable<KnownBuildInfo["contextDependencies"]>} */
|
950
|
+
(buildInfo.contextDependencies);
|
951
|
+
const missingDependencies =
|
952
|
+
/** @type {NonNullable<KnownBuildInfo["missingDependencies"]>} */
|
953
|
+
(buildInfo.missingDependencies);
|
954
|
+
|
955
|
+
fileDependencies.addAll(result.fileDependencies);
|
956
|
+
contextDependencies.addAll(result.contextDependencies);
|
957
|
+
missingDependencies.addAll(result.missingDependencies);
|
862
958
|
for (const loader of this.loaders) {
|
863
|
-
|
959
|
+
const buildDependencies =
|
960
|
+
/** @type {NonNullable<KnownBuildInfo["buildDependencies"]>} */
|
961
|
+
(buildInfo.buildDependencies);
|
962
|
+
|
963
|
+
buildDependencies.add(loader.loader);
|
864
964
|
}
|
865
|
-
|
965
|
+
buildInfo.cacheable = buildInfo.cacheable && result.cacheable;
|
866
966
|
processResult(err, result.result);
|
867
967
|
}
|
868
968
|
);
|
@@ -879,6 +979,11 @@ class NormalModule extends Module {
|
|
879
979
|
this.addError(error);
|
880
980
|
}
|
881
981
|
|
982
|
+
/**
|
983
|
+
* @param {TODO} rule rule
|
984
|
+
* @param {string} content content
|
985
|
+
* @returns {boolean} result
|
986
|
+
*/
|
882
987
|
applyNoParseRule(rule, content) {
|
883
988
|
// must start with "rule" if rule is a string
|
884
989
|
if (typeof rule === "string") {
|
@@ -892,9 +997,11 @@ class NormalModule extends Module {
|
|
892
997
|
return rule.test(content);
|
893
998
|
}
|
894
999
|
|
895
|
-
|
896
|
-
|
897
|
-
|
1000
|
+
/**
|
1001
|
+
* @param {TODO} noParseRule no parse rule
|
1002
|
+
* @param {string} request request
|
1003
|
+
* @returns {boolean} check if module should not be parsed, returns "true" if the module should !not! be parsed, returns "false" if the module !must! be parsed
|
1004
|
+
*/
|
898
1005
|
shouldPreventParsing(noParseRule, request) {
|
899
1006
|
// if no noParseRule exists, return false
|
900
1007
|
// the module !must! be parsed.
|
@@ -920,6 +1027,10 @@ class NormalModule extends Module {
|
|
920
1027
|
return false;
|
921
1028
|
}
|
922
1029
|
|
1030
|
+
/**
|
1031
|
+
* @param {Compilation} compilation compilation
|
1032
|
+
* @private
|
1033
|
+
*/
|
923
1034
|
_initBuildHash(compilation) {
|
924
1035
|
const hash = createHash(compilation.outputOptions.hashFunction);
|
925
1036
|
if (this._source) {
|
@@ -928,7 +1039,8 @@ class NormalModule extends Module {
|
|
928
1039
|
}
|
929
1040
|
hash.update("meta");
|
930
1041
|
hash.update(JSON.stringify(this.buildMeta));
|
931
|
-
|
1042
|
+
/** @type {BuildInfo} */
|
1043
|
+
(this.buildInfo).hash = /** @type {string} */ (hash.digest("hex"));
|
932
1044
|
}
|
933
1045
|
|
934
1046
|
/**
|
@@ -974,10 +1086,18 @@ class NormalModule extends Module {
|
|
974
1086
|
return callback();
|
975
1087
|
}
|
976
1088
|
|
1089
|
+
/**
|
1090
|
+
* @param {Error} e error
|
1091
|
+
* @returns {void}
|
1092
|
+
*/
|
977
1093
|
const handleParseError = e => {
|
978
|
-
const source = this._source.source();
|
1094
|
+
const source = /** @type {Source} */ (this._source).source();
|
979
1095
|
const loaders = this.loaders.map(item =>
|
980
|
-
contextify(
|
1096
|
+
contextify(
|
1097
|
+
/** @type {string} */ (options.context),
|
1098
|
+
item.loader,
|
1099
|
+
compilation.compiler.root
|
1100
|
+
)
|
981
1101
|
);
|
982
1102
|
const error = new ModuleParseError(source, e, loaders, this.type);
|
983
1103
|
this.markModuleAsErrored(error);
|
@@ -985,7 +1105,7 @@ class NormalModule extends Module {
|
|
985
1105
|
return callback();
|
986
1106
|
};
|
987
1107
|
|
988
|
-
const handleParseResult =
|
1108
|
+
const handleParseResult = () => {
|
989
1109
|
this.dependencies.sort(
|
990
1110
|
concatComparators(
|
991
1111
|
compareSelect(a => a.loc, compareLocations),
|
@@ -993,7 +1113,9 @@ class NormalModule extends Module {
|
|
993
1113
|
)
|
994
1114
|
);
|
995
1115
|
this._initBuildHash(compilation);
|
996
|
-
this._lastSuccessfulBuildMeta =
|
1116
|
+
this._lastSuccessfulBuildMeta =
|
1117
|
+
/** @type {BuildMeta} */
|
1118
|
+
(this.buildMeta);
|
997
1119
|
return handleBuildDone();
|
998
1120
|
};
|
999
1121
|
|
@@ -1006,12 +1128,17 @@ class NormalModule extends Module {
|
|
1006
1128
|
}
|
1007
1129
|
|
1008
1130
|
const snapshotOptions = compilation.options.snapshot.module;
|
1009
|
-
|
1131
|
+
const { cacheable } = /** @type {BuildInfo} */ (this.buildInfo);
|
1132
|
+
if (!cacheable || !snapshotOptions) {
|
1010
1133
|
return callback();
|
1011
1134
|
}
|
1012
1135
|
// add warning for all non-absolute paths in fileDependencies, etc
|
1013
1136
|
// This makes it easier to find problems with watching and/or caching
|
1137
|
+
/** @type {undefined | Set<string>} */
|
1014
1138
|
let nonAbsoluteDependencies = undefined;
|
1139
|
+
/**
|
1140
|
+
* @param {LazySet<string>} deps deps
|
1141
|
+
*/
|
1015
1142
|
const checkDependencies = deps => {
|
1016
1143
|
for (const dep of deps) {
|
1017
1144
|
if (!ABSOLUTE_PATH_REGEX.test(dep)) {
|
@@ -1028,7 +1155,11 @@ class NormalModule extends Module {
|
|
1028
1155
|
);
|
1029
1156
|
if (absolute !== dep && ABSOLUTE_PATH_REGEX.test(absolute)) {
|
1030
1157
|
(depWithoutGlob !== dep
|
1031
|
-
?
|
1158
|
+
? /** @type {NonNullable<KnownBuildInfo["contextDependencies"]>} */
|
1159
|
+
(
|
1160
|
+
/** @type {BuildInfo} */ (this.buildInfo)
|
1161
|
+
.contextDependencies
|
1162
|
+
)
|
1032
1163
|
: deps
|
1033
1164
|
).add(absolute);
|
1034
1165
|
}
|
@@ -1038,9 +1169,19 @@ class NormalModule extends Module {
|
|
1038
1169
|
}
|
1039
1170
|
}
|
1040
1171
|
};
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1172
|
+
const buildInfo = /** @type {BuildInfo} */ (this.buildInfo);
|
1173
|
+
const fileDependencies =
|
1174
|
+
/** @type {NonNullable<KnownBuildInfo["fileDependencies"]>} */
|
1175
|
+
(buildInfo.fileDependencies);
|
1176
|
+
const contextDependencies =
|
1177
|
+
/** @type {NonNullable<KnownBuildInfo["contextDependencies"]>} */
|
1178
|
+
(buildInfo.contextDependencies);
|
1179
|
+
const missingDependencies =
|
1180
|
+
/** @type {NonNullable<KnownBuildInfo["missingDependencies"]>} */
|
1181
|
+
(buildInfo.missingDependencies);
|
1182
|
+
checkDependencies(fileDependencies);
|
1183
|
+
checkDependencies(missingDependencies);
|
1184
|
+
checkDependencies(contextDependencies);
|
1044
1185
|
if (nonAbsoluteDependencies !== undefined) {
|
1045
1186
|
const InvalidDependenciesModuleWarning =
|
1046
1187
|
getInvalidDependenciesModuleWarning();
|
@@ -1051,19 +1192,19 @@ class NormalModule extends Module {
|
|
1051
1192
|
// convert file/context/missingDependencies into filesystem snapshot
|
1052
1193
|
compilation.fileSystemInfo.createSnapshot(
|
1053
1194
|
startTime,
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1195
|
+
fileDependencies,
|
1196
|
+
contextDependencies,
|
1197
|
+
missingDependencies,
|
1057
1198
|
snapshotOptions,
|
1058
1199
|
(err, snapshot) => {
|
1059
1200
|
if (err) {
|
1060
1201
|
this.markModuleAsErrored(err);
|
1061
1202
|
return;
|
1062
1203
|
}
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1204
|
+
buildInfo.fileDependencies = undefined;
|
1205
|
+
buildInfo.contextDependencies = undefined;
|
1206
|
+
buildInfo.missingDependencies = undefined;
|
1207
|
+
buildInfo.snapshot = snapshot;
|
1067
1208
|
return callback();
|
1068
1209
|
}
|
1069
1210
|
);
|
@@ -1082,15 +1223,16 @@ class NormalModule extends Module {
|
|
1082
1223
|
const noParseRule = options.module && options.module.noParse;
|
1083
1224
|
if (this.shouldPreventParsing(noParseRule, this.request)) {
|
1084
1225
|
// We assume that we need module and exports
|
1085
|
-
|
1226
|
+
/** @type {BuildInfo} */
|
1227
|
+
(this.buildInfo).parsed = false;
|
1086
1228
|
this._initBuildHash(compilation);
|
1087
1229
|
return handleBuildDone();
|
1088
1230
|
}
|
1089
1231
|
|
1090
|
-
let result;
|
1091
1232
|
try {
|
1092
|
-
const source = this._source.source();
|
1093
|
-
|
1233
|
+
const source = /** @type {Source} */ (this._source).source();
|
1234
|
+
/** @type {Parser} */
|
1235
|
+
(this.parser).parse(this._ast || source, {
|
1094
1236
|
source,
|
1095
1237
|
current: this,
|
1096
1238
|
module: this,
|
@@ -1098,10 +1240,10 @@ class NormalModule extends Module {
|
|
1098
1240
|
options: options
|
1099
1241
|
});
|
1100
1242
|
} catch (e) {
|
1101
|
-
handleParseError(e);
|
1243
|
+
handleParseError(/** @type {Error} */ (e));
|
1102
1244
|
return;
|
1103
1245
|
}
|
1104
|
-
handleParseResult(
|
1246
|
+
handleParseResult();
|
1105
1247
|
});
|
1106
1248
|
}
|
1107
1249
|
|
@@ -1110,7 +1252,9 @@ class NormalModule extends Module {
|
|
1110
1252
|
* @returns {string | undefined} reason why this module can't be concatenated, undefined when it can be concatenated
|
1111
1253
|
*/
|
1112
1254
|
getConcatenationBailoutReason(context) {
|
1113
|
-
return
|
1255
|
+
return /** @type {Generator} */ (
|
1256
|
+
this.generator
|
1257
|
+
).getConcatenationBailoutReason(this, context);
|
1114
1258
|
}
|
1115
1259
|
|
1116
1260
|
/**
|
@@ -1162,11 +1306,13 @@ class NormalModule extends Module {
|
|
1162
1306
|
}
|
1163
1307
|
|
1164
1308
|
/**
|
1165
|
-
* @returns {
|
1309
|
+
* @returns {SourceTypes} types available (do not mutate)
|
1166
1310
|
*/
|
1167
1311
|
getSourceTypes() {
|
1168
1312
|
if (this._sourceTypes === undefined) {
|
1169
|
-
this._sourceTypes = this.generator.getTypes(
|
1313
|
+
this._sourceTypes = /** @type {Generator} */ (this.generator).getTypes(
|
1314
|
+
this
|
1315
|
+
);
|
1170
1316
|
}
|
1171
1317
|
return this._sourceTypes;
|
1172
1318
|
}
|
@@ -1189,7 +1335,9 @@ class NormalModule extends Module {
|
|
1189
1335
|
/** @type {Set<string>} */
|
1190
1336
|
const runtimeRequirements = new Set();
|
1191
1337
|
|
1192
|
-
|
1338
|
+
const { parsed } = /** @type {BuildInfo} */ (this.buildInfo);
|
1339
|
+
|
1340
|
+
if (!parsed) {
|
1193
1341
|
runtimeRequirements.add(RuntimeGlobals.module);
|
1194
1342
|
runtimeRequirements.add(RuntimeGlobals.exports);
|
1195
1343
|
runtimeRequirements.add(RuntimeGlobals.thisAsExports);
|
@@ -1206,7 +1354,7 @@ class NormalModule extends Module {
|
|
1206
1354
|
? new RawSource(
|
1207
1355
|
"throw new Error(" + JSON.stringify(this.error.message) + ");"
|
1208
1356
|
)
|
1209
|
-
: this.generator.generate(this, {
|
1357
|
+
: /** @type {Generator} */ (this.generator).generate(this, {
|
1210
1358
|
dependencyTemplates,
|
1211
1359
|
runtimeTemplate,
|
1212
1360
|
moduleGraph,
|
@@ -1261,15 +1409,16 @@ class NormalModule extends Module {
|
|
1261
1409
|
// always try to build in case of an error
|
1262
1410
|
if (this.error) return callback(null, true);
|
1263
1411
|
|
1412
|
+
const { cacheable, snapshot, valueDependencies } =
|
1413
|
+
/** @type {BuildInfo} */ (this.buildInfo);
|
1414
|
+
|
1264
1415
|
// always build when module is not cacheable
|
1265
|
-
if (!
|
1416
|
+
if (!cacheable) return callback(null, true);
|
1266
1417
|
|
1267
1418
|
// build when there is no snapshot to check
|
1268
|
-
if (!
|
1419
|
+
if (!snapshot) return callback(null, true);
|
1269
1420
|
|
1270
1421
|
// build when valueDependencies have changed
|
1271
|
-
/** @type {Map<string, string | Set<string>>} */
|
1272
|
-
const valueDependencies = this.buildInfo.valueDependencies;
|
1273
1422
|
if (valueDependencies) {
|
1274
1423
|
if (!valueCacheVersions) return callback(null, true);
|
1275
1424
|
for (const [key, value] of valueDependencies) {
|
@@ -1288,7 +1437,7 @@ class NormalModule extends Module {
|
|
1288
1437
|
}
|
1289
1438
|
|
1290
1439
|
// check snapshot for validity
|
1291
|
-
fileSystemInfo.checkSnapshotValid(
|
1440
|
+
fileSystemInfo.checkSnapshotValid(snapshot, (err, valid) => {
|
1292
1441
|
if (err) return callback(err);
|
1293
1442
|
if (!valid) return callback(null, true);
|
1294
1443
|
const hooks = NormalModule.getCompilationHooks(compilation);
|
@@ -1316,7 +1465,10 @@ class NormalModule extends Module {
|
|
1316
1465
|
if (cachedSize !== undefined) {
|
1317
1466
|
return cachedSize;
|
1318
1467
|
}
|
1319
|
-
const size = Math.max(
|
1468
|
+
const size = Math.max(
|
1469
|
+
1,
|
1470
|
+
/** @type {Generator} */ (this.generator).getSize(this, type)
|
1471
|
+
);
|
1320
1472
|
if (this._sourceSizes === undefined) {
|
1321
1473
|
this._sourceSizes = new Map();
|
1322
1474
|
}
|
@@ -1336,7 +1488,8 @@ class NormalModule extends Module {
|
|
1336
1488
|
missingDependencies,
|
1337
1489
|
buildDependencies
|
1338
1490
|
) {
|
1339
|
-
const { snapshot, buildDependencies: buildDeps } =
|
1491
|
+
const { snapshot, buildDependencies: buildDeps } =
|
1492
|
+
/** @type {BuildInfo} */ (this.buildInfo);
|
1340
1493
|
if (snapshot) {
|
1341
1494
|
fileDependencies.addAll(snapshot.getFileIterable());
|
1342
1495
|
contextDependencies.addAll(snapshot.getContextIterable());
|
@@ -1346,7 +1499,7 @@ class NormalModule extends Module {
|
|
1346
1499
|
fileDependencies: fileDeps,
|
1347
1500
|
contextDependencies: contextDeps,
|
1348
1501
|
missingDependencies: missingDeps
|
1349
|
-
} = this.buildInfo;
|
1502
|
+
} = /** @type {BuildInfo} */ (this.buildInfo);
|
1350
1503
|
if (fileDeps !== undefined) fileDependencies.addAll(fileDeps);
|
1351
1504
|
if (contextDeps !== undefined) contextDependencies.addAll(contextDeps);
|
1352
1505
|
if (missingDeps !== undefined) missingDependencies.addAll(missingDeps);
|
@@ -1362,7 +1515,7 @@ class NormalModule extends Module {
|
|
1362
1515
|
* @returns {void}
|
1363
1516
|
*/
|
1364
1517
|
updateHash(hash, context) {
|
1365
|
-
hash.update(this.buildInfo.hash);
|
1518
|
+
hash.update(/** @type {BuildInfo} */ (this.buildInfo).hash);
|
1366
1519
|
this.generator.updateHash(hash, {
|
1367
1520
|
module: this,
|
1368
1521
|
...context
|