webpack 5.98.0 → 5.99.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/lib/AsyncDependenciesBlock.js +3 -1
- package/lib/BannerPlugin.js +1 -1
- package/lib/Cache.js +9 -7
- package/lib/CacheFacade.js +5 -5
- package/lib/Chunk.js +2 -2
- package/lib/ChunkGraph.js +21 -16
- package/lib/ChunkTemplate.js +6 -6
- package/lib/CleanPlugin.js +10 -10
- package/lib/CodeGenerationResults.js +4 -3
- package/lib/CompatibilityPlugin.js +4 -1
- package/lib/Compilation.js +326 -152
- package/lib/Compiler.js +13 -18
- package/lib/ConditionalInitFragment.js +1 -1
- package/lib/ConstPlugin.js +5 -3
- package/lib/ContextModule.js +4 -2
- package/lib/ContextModuleFactory.js +3 -3
- package/lib/ContextReplacementPlugin.js +43 -16
- package/lib/DefinePlugin.js +25 -24
- package/lib/DelegatedModule.js +4 -2
- package/lib/DelegatedModuleFactoryPlugin.js +2 -1
- package/lib/Dependency.js +19 -13
- package/lib/DependencyTemplates.js +4 -3
- package/lib/DllModule.js +4 -2
- package/lib/DllModuleFactory.js +2 -2
- package/lib/DllReferencePlugin.js +2 -1
- package/lib/DynamicEntryPlugin.js +1 -1
- package/lib/EnvironmentPlugin.js +4 -2
- package/lib/ExportsInfo.js +72 -40
- package/lib/ExternalModule.js +14 -5
- package/lib/ExternalModuleFactoryPlugin.js +24 -12
- package/lib/FileSystemInfo.js +129 -94
- package/lib/FlagDependencyExportsPlugin.js +6 -4
- package/lib/FlagDependencyUsagePlugin.js +1 -1
- package/lib/Generator.js +29 -1
- package/lib/HookWebpackError.js +2 -2
- package/lib/HotModuleReplacementPlugin.js +3 -9
- package/lib/IgnoreErrorModuleFactory.js +2 -2
- package/lib/IgnorePlugin.js +0 -5
- package/lib/InitFragment.js +1 -1
- package/lib/LoaderOptionsPlugin.js +8 -5
- package/lib/MainTemplate.js +7 -7
- package/lib/Module.js +40 -17
- package/lib/ModuleBuildError.js +3 -1
- package/lib/ModuleDependencyError.js +4 -3
- package/lib/ModuleDependencyWarning.js +4 -3
- package/lib/ModuleFactory.js +9 -3
- package/lib/ModuleFilenameHelpers.js +13 -13
- package/lib/ModuleGraph.js +20 -14
- package/lib/ModuleGraphConnection.js +7 -13
- package/lib/ModuleNotFoundError.js +1 -1
- package/lib/ModuleParseError.js +2 -1
- package/lib/ModuleSourceTypesConstants.js +11 -0
- package/lib/ModuleTemplate.js +5 -5
- package/lib/ModuleTypeConstants.js +15 -0
- package/lib/MultiCompiler.js +4 -4
- package/lib/MultiStats.js +1 -1
- package/lib/NormalModule.js +101 -54
- package/lib/NormalModuleFactory.js +38 -33
- package/lib/NormalModuleReplacementPlugin.js +3 -2
- package/lib/NullFactory.js +2 -2
- package/lib/Parser.js +4 -3
- package/lib/ProgressPlugin.js +1 -2
- package/lib/RawModule.js +4 -2
- package/lib/RecordIdsPlugin.js +6 -2
- package/lib/RequestShortener.js +3 -1
- package/lib/ResolverFactory.js +12 -9
- package/lib/RuntimeModule.js +4 -2
- package/lib/RuntimeTemplate.js +2 -1
- package/lib/SelfModuleFactory.js +2 -2
- package/lib/SourceMapDevToolPlugin.js +0 -8
- package/lib/Template.js +6 -5
- package/lib/TemplatedPathPlugin.js +15 -12
- package/lib/WebpackOptionsApply.js +1 -1
- package/lib/asset/AssetGenerator.js +237 -170
- package/lib/asset/AssetModulesPlugin.js +50 -8
- package/lib/asset/AssetSourceGenerator.js +18 -0
- package/lib/asset/RawDataUrlModule.js +4 -2
- package/lib/buildChunkGraph.js +14 -4
- package/lib/cache/MemoryWithGcCachePlugin.js +6 -2
- package/lib/cache/PackFileCacheStrategy.js +137 -121
- package/lib/cache/ResolverCachePlugin.js +15 -7
- package/lib/cache/getLazyHashedEtag.js +4 -3
- package/lib/cli.js +23 -15
- package/lib/config/defaults.js +93 -26
- package/lib/config/normalization.js +14 -13
- package/lib/config/target.js +8 -8
- package/lib/container/ContainerEntryModule.js +4 -2
- package/lib/container/ContainerEntryModuleFactory.js +2 -2
- package/lib/container/FallbackModule.js +4 -2
- package/lib/container/FallbackModuleFactory.js +2 -2
- package/lib/container/RemoteModule.js +4 -2
- package/lib/container/options.js +5 -5
- package/lib/css/CssGenerator.js +71 -9
- package/lib/css/CssModulesPlugin.js +30 -5
- package/lib/css/CssParser.js +37 -17
- package/lib/css/walkCssTokens.js +17 -17
- package/lib/debug/ProfilingPlugin.js +98 -38
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +10 -4
- package/lib/dependencies/AMDPlugin.js +5 -2
- package/lib/dependencies/AMDRequireArrayDependency.js +4 -3
- package/lib/dependencies/AMDRequireContextDependency.js +2 -1
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +15 -7
- package/lib/dependencies/AMDRuntimeModules.js +3 -1
- package/lib/dependencies/CommonJsExportRequireDependency.js +4 -5
- package/lib/dependencies/CommonJsExportsParserPlugin.js +3 -3
- package/lib/dependencies/CommonJsImportsParserPlugin.js +8 -7
- package/lib/dependencies/CommonJsRequireContextDependency.js +2 -1
- package/lib/dependencies/ContextDependencyHelpers.js +13 -6
- package/lib/dependencies/CssIcssExportDependency.js +15 -12
- package/lib/dependencies/CssIcssImportDependency.js +4 -1
- package/lib/dependencies/CssLocalIdentifierDependency.js +17 -14
- package/lib/dependencies/ExportsInfoDependency.js +6 -1
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +5 -5
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +22 -15
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +23 -8
- package/lib/dependencies/HarmonyExportSpecifierDependency.js +2 -2
- package/lib/dependencies/HarmonyImportDependency.js +8 -6
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +19 -14
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +5 -5
- package/lib/dependencies/ImportContextDependency.js +2 -1
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +8 -4
- package/lib/dependencies/JsonExportsDependency.js +24 -8
- package/lib/dependencies/LoaderPlugin.js +4 -14
- package/lib/dependencies/RequireContextDependency.js +2 -1
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +6 -3
- package/lib/dependencies/RequireEnsureDependenciesBlock.js +3 -2
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +11 -5
- package/lib/dependencies/RequireResolveContextDependency.js +1 -1
- package/lib/dependencies/WebAssemblyExportImportedDependency.js +1 -1
- package/lib/dependencies/WorkerDependency.js +6 -3
- package/lib/dependencies/WorkerPlugin.js +100 -41
- package/lib/esm/ModuleChunkFormatPlugin.js +5 -0
- package/lib/hmr/HotModuleReplacement.runtime.js +1 -0
- package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +1 -0
- package/lib/hmr/LazyCompilationPlugin.js +32 -24
- package/lib/hmr/lazyCompilationBackend.js +1 -1
- package/lib/ids/DeterministicModuleIdsPlugin.js +1 -1
- package/lib/ids/HashedModuleIdsPlugin.js +2 -1
- package/lib/ids/IdHelpers.js +15 -14
- package/lib/ids/SyncModuleIdsPlugin.js +9 -5
- package/lib/index.js +5 -5
- package/lib/javascript/BasicEvaluatedExpression.js +6 -6
- package/lib/javascript/JavascriptGenerator.js +11 -1
- package/lib/javascript/JavascriptModulesPlugin.js +51 -31
- package/lib/javascript/JavascriptParser.js +287 -188
- package/lib/javascript/JavascriptParserHelpers.js +10 -9
- package/lib/javascript/StartupHelpers.js +4 -1
- package/lib/json/JsonData.js +4 -4
- package/lib/json/JsonGenerator.js +54 -22
- package/lib/json/JsonModulesPlugin.js +16 -2
- package/lib/json/JsonParser.js +8 -4
- package/lib/library/AbstractLibraryPlugin.js +7 -3
- package/lib/library/AssignLibraryPlugin.js +29 -1
- package/lib/library/EnableLibraryPlugin.js +7 -10
- package/lib/library/ExportPropertyLibraryPlugin.js +4 -1
- package/lib/library/ModuleLibraryPlugin.js +121 -15
- package/lib/logging/Logger.js +2 -2
- package/lib/logging/createConsoleLogger.js +4 -4
- package/lib/node/NodeEnvironmentPlugin.js +6 -2
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +1 -2
- package/lib/node/ReadFileCompileWasmPlugin.js +1 -2
- package/lib/node/nodeConsole.js +3 -1
- package/lib/optimize/AggressiveSplittingPlugin.js +1 -1
- package/lib/optimize/ConcatenatedModule.js +19 -12
- package/lib/optimize/InnerGraph.js +3 -2
- package/lib/optimize/InnerGraphPlugin.js +13 -7
- package/lib/optimize/LimitChunkCountPlugin.js +20 -0
- package/lib/optimize/ModuleConcatenationPlugin.js +10 -7
- package/lib/optimize/RealContentHashPlugin.js +8 -4
- package/lib/optimize/SideEffectsFlagPlugin.js +4 -2
- package/lib/optimize/SplitChunksPlugin.js +87 -65
- package/lib/rules/BasicEffectRulePlugin.js +9 -1
- package/lib/rules/BasicMatcherRulePlugin.js +15 -4
- package/lib/rules/ObjectMatcherRulePlugin.js +12 -3
- package/lib/rules/RuleSetCompiler.js +25 -14
- package/lib/rules/UseEffectRulePlugin.js +47 -17
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +6 -6
- package/lib/schemes/HttpUriPlugin.js +38 -17
- package/lib/serialization/BinaryMiddleware.js +52 -19
- package/lib/serialization/FileMiddleware.js +78 -48
- package/lib/serialization/ObjectMiddleware.js +78 -29
- package/lib/serialization/PlainObjectSerializer.js +1 -1
- package/lib/serialization/Serializer.js +15 -10
- package/lib/serialization/SerializerMiddleware.js +80 -41
- package/lib/serialization/SingleItemMiddleware.js +10 -7
- package/lib/serialization/types.js +1 -1
- package/lib/sharing/ConsumeSharedModule.js +4 -2
- package/lib/sharing/ProvideSharedModule.js +4 -2
- package/lib/sharing/ProvideSharedModuleFactory.js +5 -3
- package/lib/sharing/utils.js +2 -2
- package/lib/stats/DefaultStatsFactoryPlugin.js +80 -78
- package/lib/stats/DefaultStatsPresetPlugin.js +43 -23
- package/lib/stats/DefaultStatsPrinterPlugin.js +85 -43
- package/lib/stats/StatsFactory.js +11 -11
- package/lib/stats/StatsPrinter.js +7 -7
- package/lib/util/ArrayHelpers.js +2 -4
- package/lib/util/ArrayQueue.js +1 -1
- package/lib/util/AsyncQueue.js +4 -4
- package/lib/util/IterableHelpers.js +1 -1
- package/lib/util/LazyBucketSortedSet.js +41 -23
- package/lib/util/LazySet.js +3 -2
- package/lib/util/MapHelpers.js +1 -1
- package/lib/util/ParallelismFactorCalculator.js +1 -1
- package/lib/util/Semaphore.js +3 -3
- package/lib/util/SetHelpers.js +1 -1
- package/lib/util/SortableSet.js +9 -7
- package/lib/util/TupleQueue.js +9 -8
- package/lib/util/TupleSet.js +2 -2
- package/lib/util/WeakTupleMap.js +12 -11
- package/lib/util/binarySearchBounds.js +2 -1
- package/lib/util/cleverMerge.js +84 -54
- package/lib/util/comparators.js +22 -21
- package/lib/util/compileBooleanMatcher.js +3 -3
- package/lib/util/concatenate.js +6 -4
- package/lib/util/create-schema-validation.js +4 -4
- package/lib/util/createHash.js +2 -2
- package/lib/util/deprecation.js +35 -33
- package/lib/util/deterministicGrouping.js +6 -6
- package/lib/util/findGraphRoots.js +1 -1
- package/lib/util/fs.js +39 -39
- package/lib/util/hash/wasm-hash.js +2 -2
- package/lib/util/identifier.js +15 -18
- package/lib/util/makeSerializable.js +1 -1
- package/lib/util/memoize.js +4 -1
- package/lib/util/objectToMap.js +3 -2
- package/lib/util/processAsyncTree.js +2 -2
- package/lib/util/propertyName.js +0 -1
- package/lib/util/registerExternalSerializer.js +15 -18
- package/lib/util/removeBOM.js +25 -0
- package/lib/util/runtime.js +34 -27
- package/lib/util/serialization.js +5 -16
- package/lib/util/smartGrouping.js +3 -3
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +3 -3
- package/lib/wasm-async/AsyncWebAssemblyGenerator.js +11 -0
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +10 -0
- package/lib/wasm-async/UniversalCompileAsyncWasmPlugin.js +4 -0
- package/lib/wasm-sync/WebAssemblyGenerator.js +28 -12
- package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +10 -0
- package/lib/wasm-sync/WebAssemblyParser.js +9 -4
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +3 -0
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +30 -25
- package/package.json +19 -17
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +48 -13
- package/schemas/plugins/JsonModulesPluginGenerator.check.d.ts +7 -0
- package/schemas/plugins/JsonModulesPluginGenerator.check.js +6 -0
- package/schemas/plugins/JsonModulesPluginGenerator.json +11 -0
- package/schemas/plugins/SourceMapDevToolPlugin.json +2 -2
- package/types.d.ts +918 -615
- package/lib/library/ModernModuleLibraryPlugin.js +0 -144
@@ -32,7 +32,9 @@ const nonNumericOnlyHash = require("../util/nonNumericOnlyHash");
|
|
32
32
|
/** @typedef {import("../../declarations/WebpackOptions").AssetGeneratorOptions} AssetGeneratorOptions */
|
33
33
|
/** @typedef {import("../../declarations/WebpackOptions").AssetModuleFilename} AssetModuleFilename */
|
34
34
|
/** @typedef {import("../../declarations/WebpackOptions").AssetModuleOutputPath} AssetModuleOutputPath */
|
35
|
+
/** @typedef {import("../../declarations/WebpackOptions").AssetResourceGeneratorOptions} AssetResourceGeneratorOptions */
|
35
36
|
/** @typedef {import("../../declarations/WebpackOptions").RawPublicPath} RawPublicPath */
|
37
|
+
/** @typedef {import("../ChunkGraph")} ChunkGraph */
|
36
38
|
/** @typedef {import("../Compilation")} Compilation */
|
37
39
|
/** @typedef {import("../Compilation").AssetInfo} AssetInfo */
|
38
40
|
/** @typedef {import("../Compilation").InterpolatedPathAndAssetInfo} InterpolatedPathAndAssetInfo */
|
@@ -50,12 +52,13 @@ const nonNumericOnlyHash = require("../util/nonNumericOnlyHash");
|
|
50
52
|
/** @typedef {import("../TemplatedPathPlugin").TemplatePath} TemplatePath */
|
51
53
|
/** @typedef {import("../util/Hash")} Hash */
|
52
54
|
/** @typedef {import("../util/createHash").Algorithm} Algorithm */
|
55
|
+
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
53
56
|
|
54
57
|
/**
|
55
58
|
* @template T
|
56
59
|
* @template U
|
57
|
-
* @param {Array<T> | Set<T>} a a
|
58
|
-
* @param {Array<U> | Set<U>} b b
|
60
|
+
* @param {string | Array<T> | Set<T> | undefined} a a
|
61
|
+
* @param {string | Array<U> | Set<U> | undefined} b b
|
59
62
|
* @returns {Array<T> & Array<U>} array
|
60
63
|
*/
|
61
64
|
const mergeMaybeArrays = (a, b) => {
|
@@ -68,13 +71,12 @@ const mergeMaybeArrays = (a, b) => {
|
|
68
71
|
};
|
69
72
|
|
70
73
|
/**
|
71
|
-
* @
|
72
|
-
* @
|
73
|
-
* @
|
74
|
-
* @param {TODO} b b
|
75
|
-
* @returns {T & U} object
|
74
|
+
* @param {AssetInfo} a a
|
75
|
+
* @param {AssetInfo} b b
|
76
|
+
* @returns {AssetInfo} object
|
76
77
|
*/
|
77
78
|
const mergeAssetInfo = (a, b) => {
|
79
|
+
/** @type {AssetInfo} */
|
78
80
|
const result = { ...a, ...b };
|
79
81
|
for (const key of Object.keys(a)) {
|
80
82
|
if (key in b) {
|
@@ -93,7 +95,12 @@ const mergeAssetInfo = (a, b) => {
|
|
93
95
|
result[key] = a[key] || b[key];
|
94
96
|
break;
|
95
97
|
case "related":
|
96
|
-
result[key] = mergeRelatedInfo(
|
98
|
+
result[key] = mergeRelatedInfo(
|
99
|
+
/** @type {NonNullable<AssetInfo["related"]>} */
|
100
|
+
(a[key]),
|
101
|
+
/** @type {NonNullable<AssetInfo["related"]>} */
|
102
|
+
(b[key])
|
103
|
+
);
|
97
104
|
break;
|
98
105
|
default:
|
99
106
|
throw new Error(`Can't handle conflicting asset info for ${key}`);
|
@@ -104,11 +111,9 @@ const mergeAssetInfo = (a, b) => {
|
|
104
111
|
};
|
105
112
|
|
106
113
|
/**
|
107
|
-
* @
|
108
|
-
* @
|
109
|
-
* @
|
110
|
-
* @param {TODO} b b
|
111
|
-
* @returns {T & U} object
|
114
|
+
* @param {NonNullable<AssetInfo["related"]>} a a
|
115
|
+
* @param {NonNullable<AssetInfo["related"]>} b b
|
116
|
+
* @returns {NonNullable<AssetInfo["related"]>} object
|
112
117
|
*/
|
113
118
|
const mergeRelatedInfo = (a, b) => {
|
114
119
|
const result = { ...a, ...b };
|
@@ -212,7 +217,7 @@ class AssetGenerator extends Generator {
|
|
212
217
|
* @param {RuntimeTemplate} runtimeTemplate runtime template
|
213
218
|
* @returns {string} source file name
|
214
219
|
*/
|
215
|
-
getSourceFileName(module, runtimeTemplate) {
|
220
|
+
static getSourceFileName(module, runtimeTemplate) {
|
216
221
|
return makePathsRelative(
|
217
222
|
runtimeTemplate.compilation.compiler.context,
|
218
223
|
module.matchResource || module.resource,
|
@@ -220,6 +225,180 @@ class AssetGenerator extends Generator {
|
|
220
225
|
).replace(/^\.\//, "");
|
221
226
|
}
|
222
227
|
|
228
|
+
/**
|
229
|
+
* @param {NormalModule} module module
|
230
|
+
* @param {RuntimeTemplate} runtimeTemplate runtime template
|
231
|
+
* @returns {[string, string]} return full hash and non-numeric full hash
|
232
|
+
*/
|
233
|
+
static getFullContentHash(module, runtimeTemplate) {
|
234
|
+
const hash = createHash(
|
235
|
+
/** @type {Algorithm} */
|
236
|
+
(runtimeTemplate.outputOptions.hashFunction)
|
237
|
+
);
|
238
|
+
|
239
|
+
if (runtimeTemplate.outputOptions.hashSalt) {
|
240
|
+
hash.update(runtimeTemplate.outputOptions.hashSalt);
|
241
|
+
}
|
242
|
+
|
243
|
+
const source = module.originalSource();
|
244
|
+
|
245
|
+
if (source) {
|
246
|
+
hash.update(source.buffer());
|
247
|
+
}
|
248
|
+
|
249
|
+
if (module.error) {
|
250
|
+
hash.update(module.error.toString());
|
251
|
+
}
|
252
|
+
|
253
|
+
const fullContentHash = /** @type {string} */ (
|
254
|
+
hash.digest(runtimeTemplate.outputOptions.hashDigest)
|
255
|
+
);
|
256
|
+
|
257
|
+
/** @type {string} */
|
258
|
+
const contentHash = nonNumericOnlyHash(
|
259
|
+
fullContentHash,
|
260
|
+
/** @type {number} */
|
261
|
+
(runtimeTemplate.outputOptions.hashDigestLength)
|
262
|
+
);
|
263
|
+
|
264
|
+
return [fullContentHash, contentHash];
|
265
|
+
}
|
266
|
+
|
267
|
+
/**
|
268
|
+
* @param {NormalModule} module module for which the code should be generated
|
269
|
+
* @param {Pick<AssetResourceGeneratorOptions, "filename" | "outputPath">} generatorOptions generator options
|
270
|
+
* @param {{ runtime: RuntimeSpec, runtimeTemplate: RuntimeTemplate, chunkGraph: ChunkGraph }} generateContext context for generate
|
271
|
+
* @param {string} contentHash the content hash
|
272
|
+
* @returns {{ filename: string, originalFilename: string, assetInfo: AssetInfo }} info
|
273
|
+
*/
|
274
|
+
static getFilenameWithInfo(
|
275
|
+
module,
|
276
|
+
generatorOptions,
|
277
|
+
{ runtime, runtimeTemplate, chunkGraph },
|
278
|
+
contentHash
|
279
|
+
) {
|
280
|
+
const assetModuleFilename =
|
281
|
+
generatorOptions.filename ||
|
282
|
+
/** @type {AssetModuleFilename} */
|
283
|
+
(runtimeTemplate.outputOptions.assetModuleFilename);
|
284
|
+
|
285
|
+
const sourceFilename = AssetGenerator.getSourceFileName(
|
286
|
+
module,
|
287
|
+
runtimeTemplate
|
288
|
+
);
|
289
|
+
let { path: filename, info: assetInfo } =
|
290
|
+
runtimeTemplate.compilation.getAssetPathWithInfo(assetModuleFilename, {
|
291
|
+
module,
|
292
|
+
runtime,
|
293
|
+
filename: sourceFilename,
|
294
|
+
chunkGraph,
|
295
|
+
contentHash
|
296
|
+
});
|
297
|
+
|
298
|
+
const originalFilename = filename;
|
299
|
+
|
300
|
+
if (generatorOptions.outputPath) {
|
301
|
+
const { path: outputPath, info } =
|
302
|
+
runtimeTemplate.compilation.getAssetPathWithInfo(
|
303
|
+
generatorOptions.outputPath,
|
304
|
+
{
|
305
|
+
module,
|
306
|
+
runtime,
|
307
|
+
filename: sourceFilename,
|
308
|
+
chunkGraph,
|
309
|
+
contentHash
|
310
|
+
}
|
311
|
+
);
|
312
|
+
filename = path.posix.join(outputPath, filename);
|
313
|
+
assetInfo = mergeAssetInfo(assetInfo, info);
|
314
|
+
}
|
315
|
+
|
316
|
+
return { originalFilename, filename, assetInfo };
|
317
|
+
}
|
318
|
+
|
319
|
+
/**
|
320
|
+
* @param {NormalModule} module module for which the code should be generated
|
321
|
+
* @param {Pick<AssetResourceGeneratorOptions, "publicPath">} generatorOptions generator options
|
322
|
+
* @param {GenerateContext} generateContext context for generate
|
323
|
+
* @param {string} filename the filename
|
324
|
+
* @param {AssetInfo} assetInfo the asset info
|
325
|
+
* @param {string} contentHash the content hash
|
326
|
+
* @returns {{ assetPath: string, assetInfo: AssetInfo }} asset path and info
|
327
|
+
*/
|
328
|
+
static getAssetPathWithInfo(
|
329
|
+
module,
|
330
|
+
generatorOptions,
|
331
|
+
{ runtime, runtimeTemplate, type, chunkGraph, runtimeRequirements },
|
332
|
+
filename,
|
333
|
+
assetInfo,
|
334
|
+
contentHash
|
335
|
+
) {
|
336
|
+
const sourceFilename = AssetGenerator.getSourceFileName(
|
337
|
+
module,
|
338
|
+
runtimeTemplate
|
339
|
+
);
|
340
|
+
|
341
|
+
let assetPath;
|
342
|
+
|
343
|
+
if (generatorOptions.publicPath !== undefined && type === "javascript") {
|
344
|
+
const { path, info } = runtimeTemplate.compilation.getAssetPathWithInfo(
|
345
|
+
generatorOptions.publicPath,
|
346
|
+
{
|
347
|
+
module,
|
348
|
+
runtime,
|
349
|
+
filename: sourceFilename,
|
350
|
+
chunkGraph,
|
351
|
+
contentHash
|
352
|
+
}
|
353
|
+
);
|
354
|
+
assetInfo = mergeAssetInfo(assetInfo, info);
|
355
|
+
assetPath = JSON.stringify(path + filename);
|
356
|
+
} else if (
|
357
|
+
generatorOptions.publicPath !== undefined &&
|
358
|
+
type === "css-url"
|
359
|
+
) {
|
360
|
+
const { path, info } = runtimeTemplate.compilation.getAssetPathWithInfo(
|
361
|
+
generatorOptions.publicPath,
|
362
|
+
{
|
363
|
+
module,
|
364
|
+
runtime,
|
365
|
+
filename: sourceFilename,
|
366
|
+
chunkGraph,
|
367
|
+
contentHash
|
368
|
+
}
|
369
|
+
);
|
370
|
+
assetInfo = mergeAssetInfo(assetInfo, info);
|
371
|
+
assetPath = path + filename;
|
372
|
+
} else if (type === "javascript") {
|
373
|
+
// add __webpack_require__.p
|
374
|
+
runtimeRequirements.add(RuntimeGlobals.publicPath);
|
375
|
+
assetPath = runtimeTemplate.concatenation(
|
376
|
+
{ expr: RuntimeGlobals.publicPath },
|
377
|
+
filename
|
378
|
+
);
|
379
|
+
} else if (type === "css-url") {
|
380
|
+
const compilation = runtimeTemplate.compilation;
|
381
|
+
const path =
|
382
|
+
compilation.outputOptions.publicPath === "auto"
|
383
|
+
? CssUrlDependency.PUBLIC_PATH_AUTO
|
384
|
+
: compilation.getAssetPath(
|
385
|
+
/** @type {TemplatePath} */
|
386
|
+
(compilation.outputOptions.publicPath),
|
387
|
+
{
|
388
|
+
hash: compilation.hash
|
389
|
+
}
|
390
|
+
);
|
391
|
+
|
392
|
+
assetPath = path + filename;
|
393
|
+
}
|
394
|
+
|
395
|
+
return {
|
396
|
+
// eslint-disable-next-line object-shorthand
|
397
|
+
assetPath: /** @type {string} */ (assetPath),
|
398
|
+
assetInfo: { sourceFilename, ...assetInfo }
|
399
|
+
};
|
400
|
+
}
|
401
|
+
|
223
402
|
/**
|
224
403
|
* @param {NormalModule} module module for which the bailout reason should be determined
|
225
404
|
* @param {ConcatenationBailoutReasonContext} context context
|
@@ -335,127 +514,6 @@ class AssetGenerator extends Generator {
|
|
335
514
|
return encodedSource;
|
336
515
|
}
|
337
516
|
|
338
|
-
/**
|
339
|
-
* @private
|
340
|
-
* @param {NormalModule} module module for which the code should be generated
|
341
|
-
* @param {GenerateContext} generateContext context for generate
|
342
|
-
* @param {string} contentHash the content hash
|
343
|
-
* @returns {{ filename: string, originalFilename: string, assetInfo: AssetInfo }} info
|
344
|
-
*/
|
345
|
-
_getFilenameWithInfo(
|
346
|
-
module,
|
347
|
-
{ runtime, runtimeTemplate, chunkGraph },
|
348
|
-
contentHash
|
349
|
-
) {
|
350
|
-
const assetModuleFilename =
|
351
|
-
this.filename ||
|
352
|
-
/** @type {AssetModuleFilename} */
|
353
|
-
(runtimeTemplate.outputOptions.assetModuleFilename);
|
354
|
-
|
355
|
-
const sourceFilename = this.getSourceFileName(module, runtimeTemplate);
|
356
|
-
let { path: filename, info: assetInfo } =
|
357
|
-
runtimeTemplate.compilation.getAssetPathWithInfo(assetModuleFilename, {
|
358
|
-
module,
|
359
|
-
runtime,
|
360
|
-
filename: sourceFilename,
|
361
|
-
chunkGraph,
|
362
|
-
contentHash
|
363
|
-
});
|
364
|
-
|
365
|
-
const originalFilename = filename;
|
366
|
-
|
367
|
-
if (this.outputPath) {
|
368
|
-
const { path: outputPath, info } =
|
369
|
-
runtimeTemplate.compilation.getAssetPathWithInfo(this.outputPath, {
|
370
|
-
module,
|
371
|
-
runtime,
|
372
|
-
filename: sourceFilename,
|
373
|
-
chunkGraph,
|
374
|
-
contentHash
|
375
|
-
});
|
376
|
-
filename = path.posix.join(outputPath, filename);
|
377
|
-
assetInfo = mergeAssetInfo(assetInfo, info);
|
378
|
-
}
|
379
|
-
|
380
|
-
return { originalFilename, filename, assetInfo };
|
381
|
-
}
|
382
|
-
|
383
|
-
/**
|
384
|
-
* @private
|
385
|
-
* @param {NormalModule} module module for which the code should be generated
|
386
|
-
* @param {GenerateContext} generateContext context for generate
|
387
|
-
* @param {string} filename the filename
|
388
|
-
* @param {AssetInfo} assetInfo the asset info
|
389
|
-
* @param {string} contentHash the content hash
|
390
|
-
* @returns {{ assetPath: string, assetInfo: AssetInfo }} asset path and info
|
391
|
-
*/
|
392
|
-
_getAssetPathWithInfo(
|
393
|
-
module,
|
394
|
-
{ runtimeTemplate, runtime, chunkGraph, type, runtimeRequirements },
|
395
|
-
filename,
|
396
|
-
assetInfo,
|
397
|
-
contentHash
|
398
|
-
) {
|
399
|
-
const sourceFilename = this.getSourceFileName(module, runtimeTemplate);
|
400
|
-
|
401
|
-
let assetPath;
|
402
|
-
|
403
|
-
if (this.publicPath !== undefined && type === "javascript") {
|
404
|
-
const { path, info } = runtimeTemplate.compilation.getAssetPathWithInfo(
|
405
|
-
this.publicPath,
|
406
|
-
{
|
407
|
-
module,
|
408
|
-
runtime,
|
409
|
-
filename: sourceFilename,
|
410
|
-
chunkGraph,
|
411
|
-
contentHash
|
412
|
-
}
|
413
|
-
);
|
414
|
-
assetInfo = mergeAssetInfo(assetInfo, info);
|
415
|
-
assetPath = JSON.stringify(path + filename);
|
416
|
-
} else if (this.publicPath !== undefined && type === "css-url") {
|
417
|
-
const { path, info } = runtimeTemplate.compilation.getAssetPathWithInfo(
|
418
|
-
this.publicPath,
|
419
|
-
{
|
420
|
-
module,
|
421
|
-
runtime,
|
422
|
-
filename: sourceFilename,
|
423
|
-
chunkGraph,
|
424
|
-
contentHash
|
425
|
-
}
|
426
|
-
);
|
427
|
-
assetInfo = mergeAssetInfo(assetInfo, info);
|
428
|
-
assetPath = path + filename;
|
429
|
-
} else if (type === "javascript") {
|
430
|
-
// add __webpack_require__.p
|
431
|
-
runtimeRequirements.add(RuntimeGlobals.publicPath);
|
432
|
-
assetPath = runtimeTemplate.concatenation(
|
433
|
-
{ expr: RuntimeGlobals.publicPath },
|
434
|
-
filename
|
435
|
-
);
|
436
|
-
} else if (type === "css-url") {
|
437
|
-
const compilation = runtimeTemplate.compilation;
|
438
|
-
const path =
|
439
|
-
compilation.outputOptions.publicPath === "auto"
|
440
|
-
? CssUrlDependency.PUBLIC_PATH_AUTO
|
441
|
-
: compilation.getAssetPath(
|
442
|
-
/** @type {TemplatePath} */
|
443
|
-
(compilation.outputOptions.publicPath),
|
444
|
-
{
|
445
|
-
hash: compilation.hash
|
446
|
-
}
|
447
|
-
);
|
448
|
-
|
449
|
-
assetPath = path + filename;
|
450
|
-
}
|
451
|
-
|
452
|
-
return {
|
453
|
-
// eslint-disable-next-line object-shorthand
|
454
|
-
assetPath: /** @type {string} */ (assetPath),
|
455
|
-
assetInfo: { sourceFilename, ...assetInfo }
|
456
|
-
};
|
457
|
-
}
|
458
|
-
|
459
517
|
/**
|
460
518
|
* @param {NormalModule} module module for which the code should be generated
|
461
519
|
* @param {GenerateContext} generateContext context for generate
|
@@ -489,53 +547,40 @@ class AssetGenerator extends Generator {
|
|
489
547
|
data.set("url", { [type]: content, ...data.get("url") });
|
490
548
|
}
|
491
549
|
} else {
|
492
|
-
const
|
493
|
-
|
494
|
-
|
550
|
+
const [fullContentHash, contentHash] = AssetGenerator.getFullContentHash(
|
551
|
+
module,
|
552
|
+
runtimeTemplate
|
495
553
|
);
|
496
554
|
|
497
|
-
if (runtimeTemplate.outputOptions.hashSalt) {
|
498
|
-
hash.update(runtimeTemplate.outputOptions.hashSalt);
|
499
|
-
}
|
500
|
-
|
501
|
-
hash.update(/** @type {Source} */ (module.originalSource()).buffer());
|
502
|
-
|
503
|
-
const fullHash =
|
504
|
-
/** @type {string} */
|
505
|
-
(hash.digest(runtimeTemplate.outputOptions.hashDigest));
|
506
|
-
|
507
555
|
if (data) {
|
508
|
-
data.set("fullContentHash",
|
556
|
+
data.set("fullContentHash", fullContentHash);
|
557
|
+
data.set("contentHash", contentHash);
|
509
558
|
}
|
510
559
|
|
511
560
|
/** @type {BuildInfo} */
|
512
|
-
(module.buildInfo).fullContentHash =
|
513
|
-
|
514
|
-
/** @type {string} */
|
515
|
-
const contentHash = nonNumericOnlyHash(
|
516
|
-
fullHash,
|
517
|
-
/** @type {number} */
|
518
|
-
(generateContext.runtimeTemplate.outputOptions.hashDigestLength)
|
519
|
-
);
|
520
|
-
|
521
|
-
if (data) {
|
522
|
-
data.set("contentHash", contentHash);
|
523
|
-
}
|
561
|
+
(module.buildInfo).fullContentHash = fullContentHash;
|
524
562
|
|
525
563
|
const { originalFilename, filename, assetInfo } =
|
526
|
-
|
564
|
+
AssetGenerator.getFilenameWithInfo(
|
565
|
+
module,
|
566
|
+
{ filename: this.filename, outputPath: this.outputPath },
|
567
|
+
generateContext,
|
568
|
+
contentHash
|
569
|
+
);
|
527
570
|
|
528
571
|
if (data) {
|
529
572
|
data.set("filename", filename);
|
530
573
|
}
|
531
574
|
|
532
|
-
let { assetPath, assetInfo: newAssetInfo } =
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
575
|
+
let { assetPath, assetInfo: newAssetInfo } =
|
576
|
+
AssetGenerator.getAssetPathWithInfo(
|
577
|
+
module,
|
578
|
+
{ publicPath: this.publicPath },
|
579
|
+
generateContext,
|
580
|
+
originalFilename,
|
581
|
+
assetInfo,
|
582
|
+
contentHash
|
583
|
+
);
|
539
584
|
|
540
585
|
if (data && (type === "javascript" || type === "css-url")) {
|
541
586
|
data.set("url", { [type]: assetPath, ...data.get("url") });
|
@@ -584,6 +629,27 @@ class AssetGenerator extends Generator {
|
|
584
629
|
return /** @type {Source} */ (module.originalSource());
|
585
630
|
}
|
586
631
|
|
632
|
+
/**
|
633
|
+
* @param {Error} error the error
|
634
|
+
* @param {NormalModule} module module for which the code should be generated
|
635
|
+
* @param {GenerateContext} generateContext context for generate
|
636
|
+
* @returns {Source | null} generated code
|
637
|
+
*/
|
638
|
+
generateError(error, module, generateContext) {
|
639
|
+
switch (generateContext.type) {
|
640
|
+
case "asset": {
|
641
|
+
return new RawSource(error.message);
|
642
|
+
}
|
643
|
+
case "javascript": {
|
644
|
+
return new RawSource(
|
645
|
+
`throw new Error(${JSON.stringify(error.message)});`
|
646
|
+
);
|
647
|
+
}
|
648
|
+
default:
|
649
|
+
return null;
|
650
|
+
}
|
651
|
+
}
|
652
|
+
|
587
653
|
/**
|
588
654
|
* @param {NormalModule} module fresh module
|
589
655
|
* @returns {SourceTypes} available types (do not mutate)
|
@@ -669,6 +735,7 @@ class AssetGenerator extends Generator {
|
|
669
735
|
*/
|
670
736
|
updateHash(hash, updateHashContext) {
|
671
737
|
const { module } = updateHashContext;
|
738
|
+
|
672
739
|
if (
|
673
740
|
/** @type {BuildInfo} */
|
674
741
|
(module.buildInfo).dataUrl
|
@@ -704,7 +771,7 @@ class AssetGenerator extends Generator {
|
|
704
771
|
const pathData = {
|
705
772
|
module,
|
706
773
|
runtime,
|
707
|
-
filename:
|
774
|
+
filename: AssetGenerator.getSourceFileName(module, runtimeTemplate),
|
708
775
|
chunkGraph,
|
709
776
|
contentHash: runtimeTemplate.contentHashReplacement
|
710
777
|
};
|
@@ -19,10 +19,12 @@ const memoize = require("../util/memoize");
|
|
19
19
|
/** @typedef {import("webpack-sources").Source} Source */
|
20
20
|
/** @typedef {import("../../declarations/WebpackOptions").AssetParserOptions} AssetParserOptions */
|
21
21
|
/** @typedef {import("../Chunk")} Chunk */
|
22
|
+
/** @typedef {import("../Compilation").AssetInfo} AssetInfo */
|
22
23
|
/** @typedef {import("../Compiler")} Compiler */
|
23
24
|
/** @typedef {import("../Module")} Module */
|
24
25
|
/** @typedef {import("../Module").BuildInfo} BuildInfo */
|
25
26
|
/** @typedef {import("../Module").CodeGenerationResult} CodeGenerationResult */
|
27
|
+
/** @typedef {import("../NormalModule")} NormalModule */
|
26
28
|
|
27
29
|
/**
|
28
30
|
* @param {string} name name of definitions
|
@@ -184,7 +186,7 @@ class AssetModulesPlugin {
|
|
184
186
|
|
185
187
|
compilation.hooks.renderManifest.tap(plugin, (result, options) => {
|
186
188
|
const { chunkGraph } = compilation;
|
187
|
-
const { chunk, codeGenerationResults } = options;
|
189
|
+
const { chunk, codeGenerationResults, runtimeTemplate } = options;
|
188
190
|
|
189
191
|
const modules = chunkGraph.getOrderedChunkModulesIterableBySourceType(
|
190
192
|
chunk,
|
@@ -203,18 +205,58 @@ class AssetModulesPlugin {
|
|
203
205
|
/** @type {NonNullable<CodeGenerationResult["data"]>} */
|
204
206
|
(codeGenResult.data);
|
205
207
|
const errored = module.getNumberOfErrors() > 0;
|
208
|
+
|
209
|
+
/** @type {string} */
|
210
|
+
let entryFilename;
|
211
|
+
/** @type {AssetInfo} */
|
212
|
+
let entryInfo;
|
213
|
+
/** @type {string} */
|
214
|
+
let entryHash;
|
215
|
+
|
216
|
+
if (errored) {
|
217
|
+
const erroredModule = /** @type {NormalModule} */ (module);
|
218
|
+
const AssetGenerator = getAssetGenerator();
|
219
|
+
const [fullContentHash, contentHash] =
|
220
|
+
AssetGenerator.getFullContentHash(
|
221
|
+
erroredModule,
|
222
|
+
runtimeTemplate
|
223
|
+
);
|
224
|
+
const { filename, assetInfo } =
|
225
|
+
AssetGenerator.getFilenameWithInfo(
|
226
|
+
erroredModule,
|
227
|
+
{
|
228
|
+
filename:
|
229
|
+
erroredModule.generatorOptions &&
|
230
|
+
erroredModule.generatorOptions.filename,
|
231
|
+
outputPath:
|
232
|
+
erroredModule.generatorOptions &&
|
233
|
+
erroredModule.generatorOptions.outputPath
|
234
|
+
},
|
235
|
+
{
|
236
|
+
runtime: chunk.runtime,
|
237
|
+
runtimeTemplate,
|
238
|
+
chunkGraph
|
239
|
+
},
|
240
|
+
contentHash
|
241
|
+
);
|
242
|
+
entryFilename = filename;
|
243
|
+
entryInfo = assetInfo;
|
244
|
+
entryHash = fullContentHash;
|
245
|
+
} else {
|
246
|
+
entryFilename = buildInfo.filename || data.get("filename");
|
247
|
+
entryInfo = buildInfo.assetInfo || data.get("assetInfo");
|
248
|
+
entryHash =
|
249
|
+
buildInfo.fullContentHash || data.get("fullContentHash");
|
250
|
+
}
|
251
|
+
|
206
252
|
result.push({
|
207
253
|
render: () =>
|
208
254
|
/** @type {Source} */ (codeGenResult.sources.get(type)),
|
209
|
-
filename:
|
210
|
-
|
211
|
-
: buildInfo.filename || data.get("filename"),
|
212
|
-
info: buildInfo.assetInfo || data.get("assetInfo"),
|
255
|
+
filename: entryFilename,
|
256
|
+
info: entryInfo,
|
213
257
|
auxiliary: true,
|
214
258
|
identifier: `assetModule${chunkGraph.getModuleId(module)}`,
|
215
|
-
hash:
|
216
|
-
? chunkGraph.getModuleHash(module, chunk.runtime)
|
217
|
-
: buildInfo.fullContentHash || data.get("fullContentHash")
|
259
|
+
hash: entryHash
|
218
260
|
});
|
219
261
|
} catch (err) {
|
220
262
|
/** @type {Error} */ (err).message +=
|
@@ -90,6 +90,24 @@ class AssetSourceGenerator extends Generator {
|
|
90
90
|
}
|
91
91
|
}
|
92
92
|
|
93
|
+
/**
|
94
|
+
* @param {Error} error the error
|
95
|
+
* @param {NormalModule} module module for which the code should be generated
|
96
|
+
* @param {GenerateContext} generateContext context for generate
|
97
|
+
* @returns {Source | null} generated code
|
98
|
+
*/
|
99
|
+
generateError(error, module, generateContext) {
|
100
|
+
switch (generateContext.type) {
|
101
|
+
case "javascript": {
|
102
|
+
return new RawSource(
|
103
|
+
`throw new Error(${JSON.stringify(error.message)});`
|
104
|
+
);
|
105
|
+
}
|
106
|
+
default:
|
107
|
+
return null;
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
93
111
|
/**
|
94
112
|
* @param {NormalModule} module module for which the bailout reason should be determined
|
95
113
|
* @param {ConcatenationBailoutReasonContext} context context
|
@@ -15,8 +15,10 @@ const makeSerializable = require("../util/makeSerializable");
|
|
15
15
|
/** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */
|
16
16
|
/** @typedef {import("../Compilation")} Compilation */
|
17
17
|
/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */
|
18
|
+
/** @typedef {import("../Module").BuildCallback} BuildCallback */
|
18
19
|
/** @typedef {import("../Module").CodeGenerationContext} CodeGenerationContext */
|
19
20
|
/** @typedef {import("../Module").CodeGenerationResult} CodeGenerationResult */
|
21
|
+
/** @typedef {import("../Module").NeedBuildCallback} NeedBuildCallback */
|
20
22
|
/** @typedef {import("../Module").NeedBuildContext} NeedBuildContext */
|
21
23
|
/** @typedef {import("../Module").SourceTypes} SourceTypes */
|
22
24
|
/** @typedef {import("../RequestShortener")} RequestShortener */
|
@@ -77,7 +79,7 @@ class RawDataUrlModule extends Module {
|
|
77
79
|
|
78
80
|
/**
|
79
81
|
* @param {NeedBuildContext} context context info
|
80
|
-
* @param {
|
82
|
+
* @param {NeedBuildCallback} callback callback function, returns true, if the module needs a rebuild
|
81
83
|
* @returns {void}
|
82
84
|
*/
|
83
85
|
needBuild(context, callback) {
|
@@ -89,7 +91,7 @@ class RawDataUrlModule extends Module {
|
|
89
91
|
* @param {Compilation} compilation the compilation
|
90
92
|
* @param {ResolverWithOptions} resolver the resolver
|
91
93
|
* @param {InputFileSystem} fs the file system
|
92
|
-
* @param {
|
94
|
+
* @param {BuildCallback} callback callback function
|
93
95
|
* @returns {void}
|
94
96
|
*/
|
95
97
|
build(options, compilation, resolver, fs, callback) {
|
package/lib/buildChunkGraph.js
CHANGED
@@ -508,7 +508,9 @@ const visitModules = (
|
|
508
508
|
cgi = {
|
509
509
|
chunkGroup: entrypoint,
|
510
510
|
initialized: false,
|
511
|
-
runtime:
|
511
|
+
runtime:
|
512
|
+
entrypoint.options.runtime ||
|
513
|
+
/** @type {string | undefined} */ (entrypoint.name),
|
512
514
|
minAvailableModules: ZERO_BIGINT,
|
513
515
|
availableModulesToBeMerged: [],
|
514
516
|
skippedItems: undefined,
|
@@ -527,11 +529,19 @@ const visitModules = (
|
|
527
529
|
? entryOptions.asyncChunks
|
528
530
|
: chunkGroupInfo.asyncChunks
|
529
531
|
};
|
530
|
-
chunkGroupInfoMap.set(
|
532
|
+
chunkGroupInfoMap.set(
|
533
|
+
entrypoint,
|
534
|
+
/** @type {ChunkGroupInfo} */
|
535
|
+
(cgi)
|
536
|
+
);
|
531
537
|
|
532
538
|
chunkGraph.connectBlockAndChunkGroup(b, entrypoint);
|
533
539
|
if (chunkName) {
|
534
|
-
namedAsyncEntrypoints.set(
|
540
|
+
namedAsyncEntrypoints.set(
|
541
|
+
chunkName,
|
542
|
+
/** @type {ChunkGroupInfo} */
|
543
|
+
(cgi)
|
544
|
+
);
|
535
545
|
}
|
536
546
|
} else {
|
537
547
|
entrypoint = /** @type {Entrypoint} */ (cgi.chunkGroup);
|
@@ -551,7 +561,7 @@ const visitModules = (
|
|
551
561
|
module,
|
552
562
|
chunk: entrypoint.chunks[0],
|
553
563
|
chunkGroup: entrypoint,
|
554
|
-
chunkGroupInfo: cgi
|
564
|
+
chunkGroupInfo: /** @type {ChunkGroupInfo} */ (cgi)
|
555
565
|
});
|
556
566
|
} else if (!chunkGroupInfo.asyncChunks || !chunkGroupInfo.chunkLoading) {
|
557
567
|
// Just queue the block into the current chunk group
|