webpack 5.104.1 → 5.105.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 +2 -2
- package/bin/webpack.js +6 -3
- package/lib/APIPlugin.js +85 -15
- package/lib/AbstractMethodError.js +1 -0
- package/lib/AsyncDependenciesBlock.js +17 -2
- package/lib/AsyncDependencyToInitialChunkError.js +3 -0
- package/lib/AutomaticPrefetchPlugin.js +1 -1
- package/lib/BannerPlugin.js +5 -1
- package/lib/CacheFacade.js +2 -2
- package/lib/CaseSensitiveModulesWarning.js +1 -0
- package/lib/Chunk.js +9 -5
- package/lib/ChunkGraph.js +30 -9
- package/lib/ChunkGroup.js +6 -3
- package/lib/ChunkRenderError.js +9 -2
- package/lib/CleanPlugin.js +4 -1
- package/lib/CodeGenerationError.js +7 -1
- package/lib/CodeGenerationResults.js +10 -3
- package/lib/CommentCompilationWarning.js +2 -1
- package/lib/Compilation.js +284 -236
- package/lib/Compiler.js +4 -3
- package/lib/ConcatenationScope.js +2 -1
- package/lib/ConcurrentCompilationError.js +3 -3
- package/lib/ContextModule.js +248 -111
- package/lib/ContextModuleFactory.js +14 -2
- package/lib/DefinePlugin.js +15 -8
- package/lib/DelegatedModule.js +6 -0
- package/lib/DelegatedModuleFactoryPlugin.js +2 -0
- package/lib/Dependency.js +6 -1
- package/lib/DependencyTemplates.js +3 -2
- package/lib/DllModule.js +2 -0
- package/lib/DllReferencePlugin.js +1 -0
- package/lib/DotenvPlugin.js +11 -5
- package/lib/DynamicEntryPlugin.js +8 -1
- package/lib/EnvironmentNotSupportAsyncWarning.js +1 -0
- package/lib/EvalSourceMapDevToolPlugin.js +17 -13
- package/lib/ExportsInfo.js +8 -4
- package/lib/ExternalModule.js +16 -0
- package/lib/ExternalModuleFactoryPlugin.js +9 -2
- package/lib/ExternalsPlugin.js +2 -1
- package/lib/FalseIIFEUmdWarning.js +1 -0
- package/lib/FileSystemInfo.js +49 -25
- package/lib/FlagDependencyExportsPlugin.js +8 -1
- package/lib/FlagDependencyUsagePlugin.js +9 -7
- package/lib/HarmonyLinkingError.js +1 -0
- package/lib/HookWebpackError.js +2 -0
- package/lib/HotModuleReplacementPlugin.js +16 -2
- package/lib/IgnoreWarningsPlugin.js +5 -2
- package/lib/InitFragment.js +1 -0
- package/lib/InvalidDependenciesModuleWarning.js +1 -0
- package/lib/LibManifestPlugin.js +1 -0
- package/lib/ManifestPlugin.js +8 -1
- package/lib/Module.js +7 -4
- package/lib/ModuleBuildError.js +3 -1
- package/lib/ModuleDependencyError.js +1 -0
- package/lib/ModuleDependencyWarning.js +1 -0
- package/lib/ModuleError.js +4 -1
- package/lib/ModuleFilenameHelpers.js +4 -2
- package/lib/ModuleGraph.js +3 -0
- package/lib/ModuleGraphConnection.js +10 -1
- package/lib/ModuleHashingError.js +2 -0
- package/lib/ModuleInfoHeaderPlugin.js +6 -1
- package/lib/ModuleNotFoundError.js +1 -0
- package/lib/ModuleParseError.js +5 -1
- package/lib/ModuleProfile.js +1 -1
- package/lib/ModuleRestoreError.js +2 -0
- package/lib/ModuleSourceTypeConstants.js +1 -11
- package/lib/ModuleStoreError.js +2 -0
- package/lib/ModuleWarning.js +3 -1
- package/lib/MultiCompiler.js +11 -7
- package/lib/MultiWatching.js +2 -2
- package/lib/NoModeWarning.js +1 -0
- package/lib/NodeStuffInWebError.js +1 -0
- package/lib/NormalModule.js +28 -5
- package/lib/NormalModuleFactory.js +20 -4
- package/lib/OptionsApply.js +3 -1
- package/lib/ProgressPlugin.js +4 -0
- package/lib/RawModule.js +2 -0
- package/lib/RuntimeModule.js +10 -0
- package/lib/RuntimePlugin.js +7 -9
- package/lib/RuntimeTemplate.js +14 -7
- package/lib/SourceMapDevToolPlugin.js +30 -23
- package/lib/Template.js +10 -5
- package/lib/TemplatedPathPlugin.js +4 -2
- package/lib/UnhandledSchemeError.js +1 -0
- package/lib/UnsupportedFeatureWarning.js +3 -0
- package/lib/WarnDeprecatedOptionPlugin.js +1 -0
- package/lib/WatchIgnorePlugin.js +1 -1
- package/lib/Watching.js +5 -0
- package/lib/WebpackError.js +4 -0
- package/lib/WebpackOptionsApply.js +61 -41
- package/lib/asset/AssetBytesGenerator.js +1 -0
- package/lib/asset/AssetGenerator.js +18 -3
- package/lib/asset/AssetModulesPlugin.js +33 -2
- package/lib/asset/AssetParser.js +4 -0
- package/lib/asset/AssetSourceGenerator.js +1 -0
- package/lib/asset/RawDataUrlModule.js +4 -0
- package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -1
- package/lib/buildChunkGraph.js +31 -2
- package/lib/cache/MemoryWithGcCachePlugin.js +1 -0
- package/lib/cache/PackFileCacheStrategy.js +41 -8
- package/lib/cache/getLazyHashedEtag.js +13 -4
- package/lib/cache/mergeEtags.js +3 -1
- package/lib/cli.js +3 -1
- package/lib/config/defaults.js +65 -44
- package/lib/config/normalization.js +96 -0
- package/lib/container/ContainerEntryDependency.js +3 -0
- package/lib/container/ContainerEntryModule.js +7 -0
- package/lib/container/ContainerExposedDependency.js +1 -0
- package/lib/container/FallbackDependency.js +1 -0
- package/lib/container/FallbackItemDependency.js +1 -0
- package/lib/container/FallbackModule.js +4 -0
- package/lib/container/HoistContainerReferencesPlugin.js +6 -0
- package/lib/container/ModuleFederationPlugin.js +1 -1
- package/lib/container/RemoteModule.js +24 -0
- package/lib/css/CssGenerator.js +31 -4
- package/lib/css/CssModulesPlugin.js +26 -30
- package/lib/css/CssParser.js +12 -9
- package/lib/debug/ProfilingPlugin.js +1 -0
- package/lib/dependencies/AMDDefineDependency.js +3 -1
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +6 -0
- package/lib/dependencies/AMDPlugin.js +1 -1
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +7 -1
- package/lib/dependencies/CachedConstDependency.js +1 -0
- package/lib/dependencies/CommonJsDependencyHelpers.js +2 -0
- package/lib/dependencies/CommonJsExportRequireDependency.js +1 -0
- package/lib/dependencies/CommonJsFullRequireDependency.js +2 -0
- package/lib/dependencies/CommonJsImportsParserPlugin.js +3 -0
- package/lib/dependencies/CommonJsRequireContextDependency.js +2 -2
- package/lib/dependencies/CommonJsSelfReferenceDependency.js +1 -0
- package/lib/dependencies/ConstDependency.js +1 -0
- package/lib/dependencies/ContextDependencyHelpers.js +11 -4
- package/lib/dependencies/ContextElementDependency.js +1 -0
- package/lib/dependencies/CriticalDependencyWarning.js +1 -0
- package/lib/dependencies/CssIcssExportDependency.js +7 -4
- package/lib/dependencies/CssIcssSymbolDependency.js +1 -0
- package/lib/dependencies/CssUrlDependency.js +2 -3
- package/lib/dependencies/ExternalModuleInitFragment.js +4 -1
- package/lib/dependencies/ExternalModuleInitFragmentDependency.js +0 -9
- package/lib/dependencies/HarmonyAcceptDependency.js +3 -0
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +3 -1
- package/lib/dependencies/HarmonyExportExpressionDependency.js +4 -0
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +8 -1
- package/lib/dependencies/HarmonyExportInitFragment.js +17 -3
- package/lib/dependencies/HarmonyExportSpecifierDependency.js +4 -0
- package/lib/dependencies/HarmonyImportDependency.js +1 -1
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +269 -5
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +22 -3
- package/lib/dependencies/ImportDependency.js +1 -0
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +1 -0
- package/lib/dependencies/ImportMetaPlugin.js +53 -11
- package/lib/dependencies/ImportParserPlugin.js +7 -12
- package/lib/dependencies/LoaderPlugin.js +3 -0
- package/lib/dependencies/ModuleDecoratorDependency.js +1 -0
- package/lib/dependencies/ModuleDependency.js +1 -0
- package/lib/dependencies/ModuleInitFragmentDependency.js +87 -0
- package/lib/dependencies/ProvidedDependency.js +1 -0
- package/lib/dependencies/RequireContextPlugin.js +1 -0
- package/lib/dependencies/RequireEnsureDependenciesBlock.js +1 -1
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +7 -2
- package/lib/dependencies/RuntimeRequirementsDependency.js +1 -0
- package/lib/dependencies/WorkerDependency.js +9 -3
- package/lib/dependencies/WorkerPlugin.js +1 -0
- package/lib/dependencies/getFunctionExpression.js +3 -1
- package/lib/electron/ElectronTargetPlugin.js +3 -1
- package/lib/errors/BuildCycleError.js +4 -1
- package/lib/esm/ModuleChunkFormatPlugin.js +6 -4
- package/lib/esm/ModuleChunkLoadingPlugin.js +1 -0
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +1 -0
- package/lib/hmr/LazyCompilationPlugin.js +5 -0
- package/lib/hmr/lazyCompilationBackend.js +3 -2
- package/lib/ids/ChunkModuleIdRangePlugin.js +9 -7
- package/lib/ids/DeterministicChunkIdsPlugin.js +1 -0
- package/lib/ids/DeterministicModuleIdsPlugin.js +1 -0
- package/lib/ids/HashedModuleIdsPlugin.js +3 -8
- package/lib/ids/IdHelpers.js +10 -8
- package/lib/ids/NamedChunkIdsPlugin.js +7 -5
- package/lib/ids/NamedModuleIdsPlugin.js +1 -0
- package/lib/ids/OccurrenceChunkIdsPlugin.js +2 -2
- package/lib/ids/OccurrenceModuleIdsPlugin.js +18 -10
- package/lib/ids/SyncModuleIdsPlugin.js +30 -20
- package/lib/index.js +2 -2
- package/lib/javascript/BasicEvaluatedExpression.js +1 -0
- package/lib/javascript/EnableChunkLoadingPlugin.js +5 -2
- package/lib/javascript/JavascriptModulesPlugin.js +29 -8
- package/lib/javascript/JavascriptParser.js +47 -14
- package/lib/json/JsonGenerator.js +1 -0
- package/lib/json/JsonParser.js +9 -2
- package/lib/library/AbstractLibraryPlugin.js +4 -1
- package/lib/library/AmdLibraryPlugin.js +2 -1
- package/lib/library/AssignLibraryPlugin.js +6 -2
- package/lib/library/EnableLibraryPlugin.js +1 -0
- package/lib/library/ExportPropertyLibraryPlugin.js +1 -1
- package/lib/library/JsonpLibraryPlugin.js +1 -1
- package/lib/library/ModuleLibraryPlugin.js +130 -13
- package/lib/library/SystemLibraryPlugin.js +4 -1
- package/lib/library/UmdLibraryPlugin.js +4 -3
- package/lib/logging/Logger.js +9 -5
- package/lib/logging/createConsoleLogger.js +4 -0
- package/lib/logging/truncateArgs.js +1 -1
- package/lib/node/CommonJsChunkLoadingPlugin.js +6 -4
- package/lib/node/NodeEnvironmentPlugin.js +1 -0
- package/lib/node/NodeTargetPlugin.js +10 -1
- package/lib/node/NodeTemplatePlugin.js +1 -0
- package/lib/node/NodeWatchFileSystem.js +6 -0
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +1 -0
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +1 -0
- package/lib/node/ReadFileCompileWasmPlugin.js +1 -0
- package/lib/node/RequireChunkLoadingRuntimeModule.js +1 -0
- package/lib/node/nodeConsole.js +18 -1
- package/lib/optimize/AggressiveMergingPlugin.js +2 -1
- package/lib/optimize/AggressiveSplittingPlugin.js +15 -6
- package/lib/optimize/ConcatenatedModule.js +33 -19
- package/lib/optimize/FlagIncludedChunksPlugin.js +11 -1
- package/lib/optimize/InnerGraph.js +5 -3
- package/lib/optimize/InnerGraphPlugin.js +25 -25
- package/lib/optimize/LimitChunkCountPlugin.js +3 -2
- package/lib/optimize/MangleExportsPlugin.js +14 -2
- package/lib/optimize/MergeDuplicateChunksPlugin.js +5 -1
- package/lib/optimize/MinChunkSizePlugin.js +5 -2
- package/lib/optimize/ModuleConcatenationPlugin.js +19 -4
- package/lib/optimize/RealContentHashPlugin.js +37 -27
- package/lib/optimize/RemoveParentModulesPlugin.js +12 -3
- package/lib/optimize/RuntimeChunkPlugin.js +3 -5
- package/lib/optimize/SideEffectsFlagPlugin.js +3 -0
- package/lib/optimize/SplitChunksPlugin.js +23 -5
- package/lib/performance/AssetsOverSizeLimitWarning.js +6 -2
- package/lib/performance/EntrypointsOverSizeLimitWarning.js +6 -2
- package/lib/performance/NoAsyncChunksWarning.js +1 -0
- package/lib/performance/SizeLimitsPlugin.js +6 -6
- package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +2 -0
- package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +3 -1
- package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +1 -0
- package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +1 -0
- package/lib/rules/BasicEffectRulePlugin.js +2 -0
- package/lib/rules/BasicMatcherRulePlugin.js +3 -0
- package/lib/rules/ObjectMatcherRulePlugin.js +5 -1
- package/lib/rules/RuleSetCompiler.js +6 -0
- package/lib/runtime/AsyncModuleRuntimeModule.js +1 -0
- package/lib/runtime/ChunkNameRuntimeModule.js +1 -0
- package/lib/runtime/CompatRuntimeModule.js +1 -0
- package/lib/runtime/EnsureChunkRuntimeModule.js +1 -0
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +5 -0
- package/lib/runtime/GetFullHashRuntimeModule.js +1 -0
- package/lib/runtime/GetMainFilenameRuntimeModule.js +2 -0
- package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +1 -0
- package/lib/runtime/LoadScriptRuntimeModule.js +2 -0
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +16 -32
- package/lib/runtime/PublicPathRuntimeModule.js +1 -0
- package/lib/runtime/StartupChunkDependenciesPlugin.js +2 -0
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +1 -0
- package/lib/runtime/StartupEntrypointRuntimeModule.js +1 -0
- package/lib/schemes/HttpUriPlugin.js +39 -20
- package/lib/schemes/VirtualUrlPlugin.js +28 -2
- package/lib/serialization/BinaryMiddleware.js +4 -0
- package/lib/serialization/FileMiddleware.js +9 -4
- package/lib/serialization/ObjectMiddleware.js +34 -11
- package/lib/serialization/PlainObjectSerializer.js +2 -0
- package/lib/sharing/ConsumeSharedModule.js +60 -0
- package/lib/sharing/ConsumeSharedPlugin.js +5 -4
- package/lib/sharing/ProvideSharedModule.js +4 -0
- package/lib/sharing/ProvideSharedPlugin.js +24 -25
- package/lib/sharing/resolveMatchedConfigs.js +2 -2
- package/lib/sharing/utils.js +8 -6
- package/lib/stats/DefaultStatsFactoryPlugin.js +20 -12
- package/lib/stats/DefaultStatsPrinterPlugin.js +6 -5
- package/lib/stats/StatsFactory.js +2 -2
- package/lib/url/URLParserPlugin.js +5 -3
- package/lib/util/AppendOnlyStackedSet.js +57 -0
- package/lib/util/Hash.js +1 -0
- package/lib/util/IterableHelpers.js +1 -0
- package/lib/util/LazyBucketSortedSet.js +1 -0
- package/lib/util/LazySet.js +1 -0
- package/lib/util/ParallelismFactorCalculator.js +1 -0
- package/lib/util/SortableSet.js +1 -0
- package/lib/util/StringXor.js +1 -0
- package/lib/util/binarySearchBounds.js +15 -8
- package/lib/util/chainedImports.js +1 -1
- package/lib/util/cleverMerge.js +6 -1
- package/lib/util/comparators.js +21 -1
- package/lib/util/compileBooleanMatcher.js +3 -3
- package/lib/util/concatenate.js +3 -2
- package/lib/util/conventions.js +3 -2
- package/lib/util/deterministicGrouping.js +13 -1
- package/lib/util/extractSourceMap.js +12 -13
- package/lib/util/fs.js +15 -19
- package/lib/util/hash/BatchedHash.js +4 -0
- package/lib/util/hash/BulkUpdateHash.js +8 -1
- package/lib/util/hash/hash-digest.js +1 -0
- package/lib/util/hash/wasm-hash.js +18 -2
- package/lib/util/identifier.js +7 -2
- package/lib/util/magicComment.js +1 -1
- package/lib/util/propertyName.js +1 -1
- package/lib/util/registerExternalSerializer.js +1 -0
- package/lib/util/runtime.js +15 -1
- package/lib/util/semver.js +1 -0
- package/lib/util/serialization.js +2 -2
- package/lib/wasm/EnableWasmLoadingPlugin.js +2 -0
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +11 -3
- package/lib/wasm-async/AsyncWebAssemblyGenerator.js +1 -0
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +3 -2
- package/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +5 -1
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +3 -0
- package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +2 -0
- package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +7 -3
- package/lib/wasm-sync/WebAssemblyModulesPlugin.js +2 -2
- package/lib/wasm-sync/WebAssemblyParser.js +3 -1
- package/lib/web/FetchCompileWasmPlugin.js +1 -0
- package/lib/web/JsonpChunkLoadingPlugin.js +1 -0
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -0
- package/lib/webpack.js +16 -4
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +1 -0
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +2 -0
- package/package.json +33 -36
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +121 -55
- package/schemas/plugins/BannerPlugin.json +2 -2
- package/schemas/plugins/IgnorePlugin.json +1 -1
- package/schemas/plugins/ManifestPlugin.json +3 -3
- package/schemas/plugins/ProgressPlugin.json +1 -1
- package/schemas/plugins/SourceMapDevToolPlugin.json +2 -2
- package/schemas/plugins/schemes/HttpUriPlugin.json +1 -1
- package/schemas/plugins/schemes/VirtualUrlPlugin.json +3 -3
- package/types.d.ts +440 -137
|
@@ -33,7 +33,7 @@ const THIRTY_TWO_BIGINT = BigInt(32);
|
|
|
33
33
|
* Parses the module mask and returns the modules represented by it
|
|
34
34
|
* @param {bigint} mask the module mask
|
|
35
35
|
* @param {Module[]} ordinalModules the modules in the order they were added to the mask (LSB is index 0)
|
|
36
|
-
* @returns {Generator<Module>} the modules represented by the mask
|
|
36
|
+
* @returns {Generator<Module, undefined, undefined>} the modules represented by the mask
|
|
37
37
|
*/
|
|
38
38
|
function* getModulesFromMask(mask, ordinalModules) {
|
|
39
39
|
let offset = 31;
|
|
@@ -74,10 +74,13 @@ class RemoveParentModulesPlugin {
|
|
|
74
74
|
*/
|
|
75
75
|
const handler = (chunks, chunkGroups) => {
|
|
76
76
|
const chunkGraph = compilation.chunkGraph;
|
|
77
|
+
/** @type {Set<ChunkGroup>} */
|
|
77
78
|
const queue = new Set();
|
|
79
|
+
/** @type {WeakMap<ChunkGroup, bigint | undefined>} */
|
|
78
80
|
const availableModulesMap = new WeakMap();
|
|
79
81
|
|
|
80
82
|
let nextModuleMask = ONE_BIGINT;
|
|
83
|
+
/** @type {WeakMap<Module, bigint>} */
|
|
81
84
|
const maskByModule = new WeakMap();
|
|
82
85
|
/** @type {Module[]} */
|
|
83
86
|
const ordinalModules = [];
|
|
@@ -99,6 +102,7 @@ class RemoveParentModulesPlugin {
|
|
|
99
102
|
};
|
|
100
103
|
|
|
101
104
|
// Initialize masks by chunk and by chunk group for quicker comparisons
|
|
105
|
+
/** @type {WeakMap<Chunk, bigint>} */
|
|
102
106
|
const chunkMasks = new WeakMap();
|
|
103
107
|
for (const chunk of chunks) {
|
|
104
108
|
let mask = ZERO_BIGINT;
|
|
@@ -109,6 +113,7 @@ class RemoveParentModulesPlugin {
|
|
|
109
113
|
chunkMasks.set(chunk, mask);
|
|
110
114
|
}
|
|
111
115
|
|
|
116
|
+
/** @type {WeakMap<ChunkGroup, bigint>} */
|
|
112
117
|
const chunkGroupMasks = new WeakMap();
|
|
113
118
|
for (const chunkGroup of chunkGroups) {
|
|
114
119
|
let mask = ZERO_BIGINT;
|
|
@@ -143,7 +148,8 @@ class RemoveParentModulesPlugin {
|
|
|
143
148
|
const availableModulesInParent = availableModulesMap.get(parent);
|
|
144
149
|
if (availableModulesInParent !== undefined) {
|
|
145
150
|
const parentMask =
|
|
146
|
-
availableModulesInParent |
|
|
151
|
+
availableModulesInParent |
|
|
152
|
+
/** @type {bigint} */ (chunkGroupMasks.get(parent));
|
|
147
153
|
// If we know the available modules in parent: process these
|
|
148
154
|
if (availableModulesMask === undefined) {
|
|
149
155
|
// if we have not own info yet: create new entry
|
|
@@ -181,7 +187,10 @@ class RemoveParentModulesPlugin {
|
|
|
181
187
|
);
|
|
182
188
|
if (availableModulesSets.includes(undefined)) continue; // No info about this chunk group
|
|
183
189
|
|
|
184
|
-
const availableModulesMask = intersectMasks(
|
|
190
|
+
const availableModulesMask = intersectMasks(
|
|
191
|
+
/** @type {bigint[]} */
|
|
192
|
+
(availableModulesSets)
|
|
193
|
+
);
|
|
185
194
|
const toRemoveMask = chunkMask & availableModulesMask;
|
|
186
195
|
if (toRemoveMask !== ZERO_BIGINT) {
|
|
187
196
|
for (const module of getModulesFromMask(
|
|
@@ -16,9 +16,9 @@ class RuntimeChunkPlugin {
|
|
|
16
16
|
/**
|
|
17
17
|
* @param {{ name?: RuntimeChunkFunction }=} options options
|
|
18
18
|
*/
|
|
19
|
-
constructor(options) {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
/** @type {{ name: string | RuntimeChunkFunction }} */
|
|
20
21
|
this.options = {
|
|
21
|
-
/** @type {RuntimeChunkFunction} */
|
|
22
22
|
name: (entrypoint) => `runtime~${entrypoint.name}`,
|
|
23
23
|
...options
|
|
24
24
|
};
|
|
@@ -38,9 +38,7 @@ class RuntimeChunkPlugin {
|
|
|
38
38
|
(compilation.entries.get(entryName));
|
|
39
39
|
if (data.options.runtime === undefined && !data.options.dependOn) {
|
|
40
40
|
// Determine runtime chunk name
|
|
41
|
-
let name =
|
|
42
|
-
/** @type {string | RuntimeChunkFunction} */
|
|
43
|
-
(this.options.name);
|
|
41
|
+
let name = this.options.name;
|
|
44
42
|
if (typeof name === "function") {
|
|
45
43
|
name = name({ name: entryName });
|
|
46
44
|
}
|
|
@@ -68,6 +68,7 @@ class SideEffectsFlagPlugin {
|
|
|
68
68
|
* @param {boolean} analyseSource analyse source code for side effects
|
|
69
69
|
*/
|
|
70
70
|
constructor(analyseSource = true) {
|
|
71
|
+
/** @type {boolean} */
|
|
71
72
|
this._analyseSource = analyseSource;
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -277,6 +278,7 @@ class SideEffectsFlagPlugin {
|
|
|
277
278
|
|
|
278
279
|
logger.time("update dependencies");
|
|
279
280
|
|
|
281
|
+
/** @type {Set<Module>} */
|
|
280
282
|
const optimizedModules = new Set();
|
|
281
283
|
|
|
282
284
|
/**
|
|
@@ -291,6 +293,7 @@ class SideEffectsFlagPlugin {
|
|
|
291
293
|
module
|
|
292
294
|
)) {
|
|
293
295
|
const dep = connection.dependency;
|
|
296
|
+
/** @type {boolean} */
|
|
294
297
|
let isReexport;
|
|
295
298
|
if (
|
|
296
299
|
(isReexport =
|
|
@@ -22,7 +22,6 @@ const memoize = require("../util/memoize");
|
|
|
22
22
|
const MinMaxSizeWarning = require("./MinMaxSizeWarning");
|
|
23
23
|
|
|
24
24
|
/** @typedef {import("../../declarations/WebpackOptions").OptimizationSplitChunksCacheGroup} OptimizationSplitChunksCacheGroup */
|
|
25
|
-
/** @typedef {import("../../declarations/WebpackOptions").OptimizationSplitChunksGetCacheGroups} OptimizationSplitChunksGetCacheGroups */
|
|
26
25
|
/** @typedef {import("../../declarations/WebpackOptions").OptimizationSplitChunksOptions} OptimizationSplitChunksOptions */
|
|
27
26
|
/** @typedef {import("../../declarations/WebpackOptions").OptimizationSplitChunksSizes} OptimizationSplitChunksSizes */
|
|
28
27
|
/** @typedef {import("../config/defaults").OutputNormalizedWithDefaults} OutputOptions */
|
|
@@ -36,6 +35,7 @@ const MinMaxSizeWarning = require("./MinMaxSizeWarning");
|
|
|
36
35
|
/** @typedef {import("../TemplatedPathPlugin").TemplatePath} TemplatePath */
|
|
37
36
|
/** @typedef {import("../util/deterministicGrouping").GroupedItems<Module>} DeterministicGroupingGroupedItemsForModule */
|
|
38
37
|
/** @typedef {import("../util/deterministicGrouping").Options<Module>} DeterministicGroupingOptionsForModule */
|
|
38
|
+
/** @typedef {import("../util/deterministicGrouping").Sizes} Sizes */
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* @callback ChunkFilterFn
|
|
@@ -123,6 +123,8 @@ const MinMaxSizeWarning = require("./MinMaxSizeWarning");
|
|
|
123
123
|
* @property {ChunkGraph} chunkGraph
|
|
124
124
|
*/
|
|
125
125
|
|
|
126
|
+
/** @typedef {(module: Module) => OptimizationSplitChunksCacheGroup | OptimizationSplitChunksCacheGroup[] | void} RawGetCacheGroups */
|
|
127
|
+
|
|
126
128
|
/**
|
|
127
129
|
* @callback GetCacheGroups
|
|
128
130
|
* @param {Module} module
|
|
@@ -220,9 +222,10 @@ const getRequests = (chunk) => {
|
|
|
220
222
|
* @returns {T} result
|
|
221
223
|
*/
|
|
222
224
|
const mapObject = (obj, fn) => {
|
|
225
|
+
/** @type {T} */
|
|
223
226
|
const newObj = Object.create(null);
|
|
224
227
|
for (const key of Object.keys(obj)) {
|
|
225
|
-
newObj[key] = fn(
|
|
228
|
+
newObj[/** @type {keyof T} */ (key)] = fn(
|
|
226
229
|
obj[/** @type {keyof T} */ (key)],
|
|
227
230
|
/** @type {keyof T} */
|
|
228
231
|
(key)
|
|
@@ -454,7 +457,7 @@ const normalizeChunksFilter = (chunks) => {
|
|
|
454
457
|
};
|
|
455
458
|
|
|
456
459
|
/**
|
|
457
|
-
* @param {undefined | GetCacheGroups | Record<string, false | string | RegExp |
|
|
460
|
+
* @param {undefined | GetCacheGroups | Record<string, false | string | RegExp | RawGetCacheGroups | OptimizationSplitChunksCacheGroup>} cacheGroups the cache group options
|
|
458
461
|
* @param {DefaultSizeTypes} defaultSizeTypes the default size types
|
|
459
462
|
* @returns {GetCacheGroups} a function to get the cache groups
|
|
460
463
|
*/
|
|
@@ -478,6 +481,7 @@ const normalizeCacheGroups = (cacheGroups, defaultSizeTypes) => {
|
|
|
478
481
|
}
|
|
479
482
|
});
|
|
480
483
|
} else if (typeof option === "function") {
|
|
484
|
+
/** @type {WeakMap<OptimizationSplitChunksCacheGroup, CacheGroupSource>} */
|
|
481
485
|
const cache = new WeakMap();
|
|
482
486
|
handlers.push((module, context, results) => {
|
|
483
487
|
const result = option(module);
|
|
@@ -530,6 +534,8 @@ const normalizeCacheGroups = (cacheGroups, defaultSizeTypes) => {
|
|
|
530
534
|
return () => null;
|
|
531
535
|
};
|
|
532
536
|
|
|
537
|
+
/** @typedef {(module: Module, context: CacheGroupsContext) => boolean} CheckTestFn */
|
|
538
|
+
|
|
533
539
|
/**
|
|
534
540
|
* @param {OptimizationSplitChunksCacheGroup["test"]} test test option
|
|
535
541
|
* @param {Module} module the module
|
|
@@ -553,6 +559,8 @@ const checkTest = (test, module, context) => {
|
|
|
553
559
|
return false;
|
|
554
560
|
};
|
|
555
561
|
|
|
562
|
+
/** @typedef {(type: string) => boolean} CheckModuleTypeFn */
|
|
563
|
+
|
|
556
564
|
/**
|
|
557
565
|
* @param {OptimizationSplitChunksCacheGroup["type"]} test type option
|
|
558
566
|
* @param {Module} module the module
|
|
@@ -574,6 +582,8 @@ const checkModuleType = (test, module) => {
|
|
|
574
582
|
return false;
|
|
575
583
|
};
|
|
576
584
|
|
|
585
|
+
/** @typedef {(layer: string | null) => boolean} CheckModuleLayerFn */
|
|
586
|
+
|
|
577
587
|
/**
|
|
578
588
|
* @param {OptimizationSplitChunksCacheGroup["layer"]} test type option
|
|
579
589
|
* @param {Module} module the module
|
|
@@ -868,7 +878,7 @@ module.exports = class SplitChunksPlugin {
|
|
|
868
878
|
index <<= ONE;
|
|
869
879
|
}
|
|
870
880
|
/**
|
|
871
|
-
* @param {Iterable<Chunk>} chunks list of chunks
|
|
881
|
+
* @param {Iterable<Chunk, undefined, undefined>} chunks list of chunks
|
|
872
882
|
* @returns {bigint | Chunk} key of the chunks
|
|
873
883
|
*/
|
|
874
884
|
const getKey = (chunks) => {
|
|
@@ -921,6 +931,7 @@ module.exports = class SplitChunksPlugin {
|
|
|
921
931
|
*/
|
|
922
932
|
const groupChunksByExports = (module) => {
|
|
923
933
|
const exportsInfo = moduleGraph.getExportsInfo(module);
|
|
934
|
+
/** @type {Map<string, Chunk[]>} */
|
|
924
935
|
const groupedByUsedExports = new Map();
|
|
925
936
|
for (const chunk of chunkGraph.getModuleChunksIterable(module)) {
|
|
926
937
|
const key = exportsInfo.getUsageKey(chunk.runtime);
|
|
@@ -1082,7 +1093,8 @@ module.exports = class SplitChunksPlugin {
|
|
|
1082
1093
|
* @property {bigint | Chunk} key a key of the list
|
|
1083
1094
|
*/
|
|
1084
1095
|
|
|
1085
|
-
/** @
|
|
1096
|
+
/** @typedef {WeakMap<ChunkFilterFn, SelectedChunksResult>} ChunkMap */
|
|
1097
|
+
/** @type {WeakMap<ChunkSet | Chunk, ChunkMap>} */
|
|
1086
1098
|
const selectedChunksCacheByChunksSet = new WeakMap();
|
|
1087
1099
|
|
|
1088
1100
|
/**
|
|
@@ -1095,6 +1107,7 @@ module.exports = class SplitChunksPlugin {
|
|
|
1095
1107
|
const getSelectedChunks = (chunks, chunkFilter) => {
|
|
1096
1108
|
let entry = selectedChunksCacheByChunksSet.get(chunks);
|
|
1097
1109
|
if (entry === undefined) {
|
|
1110
|
+
/** @type {ChunkMap} */
|
|
1098
1111
|
entry = new WeakMap();
|
|
1099
1112
|
selectedChunksCacheByChunksSet.set(chunks, entry);
|
|
1100
1113
|
}
|
|
@@ -1392,7 +1405,9 @@ module.exports = class SplitChunksPlugin {
|
|
|
1392
1405
|
|
|
1393
1406
|
while (chunksInfoMap.size > 0) {
|
|
1394
1407
|
// Find best matching entry
|
|
1408
|
+
/** @type {undefined | string} */
|
|
1395
1409
|
let bestEntryKey;
|
|
1410
|
+
/** @type {undefined | ChunksInfoItem} */
|
|
1396
1411
|
let bestEntry;
|
|
1397
1412
|
for (const pair of chunksInfoMap) {
|
|
1398
1413
|
const key = pair[0];
|
|
@@ -1471,6 +1486,7 @@ module.exports = class SplitChunksPlugin {
|
|
|
1471
1486
|
item.cacheGroup._conditionalEnforce &&
|
|
1472
1487
|
checkMinSize(item.sizes, item.cacheGroup.enforceSizeThreshold);
|
|
1473
1488
|
|
|
1489
|
+
/** @type {Set<Chunk>} */
|
|
1474
1490
|
const usedChunks = new Set(item.chunks);
|
|
1475
1491
|
|
|
1476
1492
|
// Check if maxRequests condition can be fulfilled
|
|
@@ -1533,6 +1549,7 @@ module.exports = class SplitChunksPlugin {
|
|
|
1533
1549
|
usedChunks.size === 1
|
|
1534
1550
|
) {
|
|
1535
1551
|
const [chunk] = usedChunks;
|
|
1552
|
+
/** @type {SplitChunksSizes} */
|
|
1536
1553
|
const chunkSizes = Object.create(null);
|
|
1537
1554
|
for (const module of chunkGraph.getChunkModulesIterable(chunk)) {
|
|
1538
1555
|
if (!item.modules.has(module)) {
|
|
@@ -1763,6 +1780,7 @@ module.exports = class SplitChunksPlugin {
|
|
|
1763
1780
|
return key;
|
|
1764
1781
|
},
|
|
1765
1782
|
getSize(module) {
|
|
1783
|
+
/** @type {Sizes} */
|
|
1766
1784
|
const size = Object.create(null);
|
|
1767
1785
|
for (const key of module.getSourceTypes()) {
|
|
1768
1786
|
size[key] = module.size(key);
|
|
@@ -10,7 +10,7 @@ const WebpackError = require("../WebpackError");
|
|
|
10
10
|
|
|
11
11
|
/** @typedef {import("./SizeLimitsPlugin").AssetDetails} AssetDetails */
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
class AssetsOverSizeLimitWarning extends WebpackError {
|
|
14
14
|
/**
|
|
15
15
|
* @param {AssetDetails[]} assetsOverSizeLimit the assets
|
|
16
16
|
* @param {number} assetLimit the size limit
|
|
@@ -26,7 +26,11 @@ module.exports = class AssetsOverSizeLimitWarning extends WebpackError {
|
|
|
26
26
|
This can impact web performance.
|
|
27
27
|
Assets: ${assetLists}`);
|
|
28
28
|
|
|
29
|
+
/** @type {string} */
|
|
29
30
|
this.name = "AssetsOverSizeLimitWarning";
|
|
30
31
|
this.assets = assetsOverSizeLimit;
|
|
31
32
|
}
|
|
32
|
-
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** @type {typeof AssetsOverSizeLimitWarning} */
|
|
36
|
+
module.exports = AssetsOverSizeLimitWarning;
|
|
@@ -10,7 +10,7 @@ const WebpackError = require("../WebpackError");
|
|
|
10
10
|
|
|
11
11
|
/** @typedef {import("./SizeLimitsPlugin").EntrypointDetails} EntrypointDetails */
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
class EntrypointsOverSizeLimitWarning extends WebpackError {
|
|
14
14
|
/**
|
|
15
15
|
* @param {EntrypointDetails[]} entrypoints the entrypoints
|
|
16
16
|
* @param {number} entrypointLimit the size limit
|
|
@@ -29,7 +29,11 @@ module.exports = class EntrypointsOverSizeLimitWarning extends WebpackError {
|
|
|
29
29
|
)}). This can impact web performance.
|
|
30
30
|
Entrypoints:${entrypointList}\n`);
|
|
31
31
|
|
|
32
|
+
/** @type {string} */
|
|
32
33
|
this.name = "EntrypointsOverSizeLimitWarning";
|
|
33
34
|
this.entrypoints = entrypoints;
|
|
34
35
|
}
|
|
35
|
-
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** @type {typeof EntrypointsOverSizeLimitWarning} */
|
|
39
|
+
module.exports = EntrypointsOverSizeLimitWarning;
|
|
@@ -34,12 +34,9 @@ const NoAsyncChunksWarning = require("./NoAsyncChunksWarning");
|
|
|
34
34
|
/** @type {WeakSet<Entrypoint | ChunkGroup | Source>} */
|
|
35
35
|
const isOverSizeLimitSet = new WeakSet();
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* @param {Asset["info"]} info the info
|
|
41
|
-
* @returns {boolean} result
|
|
42
|
-
*/
|
|
37
|
+
/** @typedef {(name: Asset["name"], source: Asset["source"], assetInfo: Asset["info"]) => boolean} AssetFilter */
|
|
38
|
+
|
|
39
|
+
/** @type {AssetFilter} */
|
|
43
40
|
const excludeSourceMap = (name, source, info) => !info.development;
|
|
44
41
|
|
|
45
42
|
const PLUGIN_NAME = "SizeLimitsPlugin";
|
|
@@ -50,8 +47,11 @@ module.exports = class SizeLimitsPlugin {
|
|
|
50
47
|
*/
|
|
51
48
|
constructor(options) {
|
|
52
49
|
this.hints = options.hints;
|
|
50
|
+
/** @type {number | undefined} */
|
|
53
51
|
this.maxAssetSize = options.maxAssetSize;
|
|
52
|
+
/** @type {number | undefined} */
|
|
54
53
|
this.maxEntrypointSize = options.maxEntrypointSize;
|
|
54
|
+
/** @type {AssetFilter | undefined} */
|
|
55
55
|
this.assetFilter = options.assetFilter;
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -17,7 +17,9 @@ class ChunkPrefetchFunctionRuntimeModule extends RuntimeModule {
|
|
|
17
17
|
*/
|
|
18
18
|
constructor(type, runtimeFunction, runtimeHandlers) {
|
|
19
19
|
super(`chunk ${type} function`);
|
|
20
|
+
/** @type {string} */
|
|
20
21
|
this.runtimeFunction = runtimeFunction;
|
|
22
|
+
/** @type {string} */
|
|
21
23
|
this.runtimeHandlers = runtimeHandlers;
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -9,14 +9,16 @@ const RuntimeModule = require("../RuntimeModule");
|
|
|
9
9
|
const Template = require("../Template");
|
|
10
10
|
|
|
11
11
|
/** @typedef {import("../Chunk")} Chunk */
|
|
12
|
+
/** @typedef {import("../Chunk").ChunkChildOfTypeInOrder} ChunkChildOfTypeInOrder */
|
|
12
13
|
/** @typedef {import("../Compilation")} Compilation */
|
|
13
14
|
|
|
14
15
|
class ChunkPrefetchStartupRuntimeModule extends RuntimeModule {
|
|
15
16
|
/**
|
|
16
|
-
* @param {
|
|
17
|
+
* @param {ChunkChildOfTypeInOrder[]} startupChunks chunk ids to trigger when chunks are loaded
|
|
17
18
|
*/
|
|
18
19
|
constructor(startupChunks) {
|
|
19
20
|
super("startup prefetch", RuntimeModule.STAGE_TRIGGER);
|
|
21
|
+
/** @type {ChunkChildOfTypeInOrder[]} */
|
|
20
22
|
this.startupChunks = startupChunks;
|
|
21
23
|
}
|
|
22
24
|
|
|
@@ -24,7 +24,9 @@ class BasicEffectRulePlugin {
|
|
|
24
24
|
* @param {string=} effectType the effect type
|
|
25
25
|
*/
|
|
26
26
|
constructor(ruleProperty, effectType) {
|
|
27
|
+
/** @type {BasicEffectRuleKeys} */
|
|
27
28
|
this.ruleProperty = ruleProperty;
|
|
29
|
+
/** @type {string | BasicEffectRuleKeys} */
|
|
28
30
|
this.effectType = effectType || ruleProperty;
|
|
29
31
|
}
|
|
30
32
|
|
|
@@ -27,8 +27,11 @@ class BasicMatcherRulePlugin {
|
|
|
27
27
|
* @param {boolean=} invert if true, inverts the condition
|
|
28
28
|
*/
|
|
29
29
|
constructor(ruleProperty, dataProperty, invert) {
|
|
30
|
+
/** @type {BasicMatcherRuleKeys} */
|
|
30
31
|
this.ruleProperty = ruleProperty;
|
|
32
|
+
/** @type {string | BasicMatcherRuleKeys} */
|
|
31
33
|
this.dataProperty = dataProperty || ruleProperty;
|
|
34
|
+
/** @type {boolean} */
|
|
32
35
|
this.invert = invert || false;
|
|
33
36
|
}
|
|
34
37
|
|
|
@@ -18,18 +18,22 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
/** @typedef {KeysOfTypes<RuleSetRule, { [k: string]: RuleSetConditionOrConditions }>} ObjectMatcherRuleKeys */
|
|
21
|
+
/** @typedef {keyof EffectData} DataProperty */
|
|
21
22
|
|
|
22
23
|
const PLUGIN_NAME = "ObjectMatcherRulePlugin";
|
|
23
24
|
|
|
24
25
|
class ObjectMatcherRulePlugin {
|
|
25
26
|
/**
|
|
26
27
|
* @param {ObjectMatcherRuleKeys} ruleProperty the rule property
|
|
27
|
-
* @param {
|
|
28
|
+
* @param {DataProperty=} dataProperty the data property
|
|
28
29
|
* @param {RuleConditionFunction=} additionalConditionFunction need to check
|
|
29
30
|
*/
|
|
30
31
|
constructor(ruleProperty, dataProperty, additionalConditionFunction) {
|
|
32
|
+
/** @type {ObjectMatcherRuleKeys} */
|
|
31
33
|
this.ruleProperty = ruleProperty;
|
|
34
|
+
/** @type {DataProperty | ObjectMatcherRuleKeys} */
|
|
32
35
|
this.dataProperty = dataProperty || ruleProperty;
|
|
36
|
+
/** @type {RuleConditionFunction | undefined} */
|
|
33
37
|
this.additionalConditionFunction = additionalConditionFunction;
|
|
34
38
|
}
|
|
35
39
|
|
|
@@ -9,6 +9,7 @@ const { SyncHook } = require("tapable");
|
|
|
9
9
|
|
|
10
10
|
/** @typedef {import("enhanced-resolve").ResolveRequest} ResolveRequest */
|
|
11
11
|
/** @typedef {import("../../declarations/WebpackOptions").Falsy} Falsy */
|
|
12
|
+
/** @typedef {import("../../declarations/WebpackOptions").RuleSetUseItem} RuleSetUseItem */
|
|
12
13
|
/** @typedef {import("../../declarations/WebpackOptions").RuleSetLoaderOptions} RuleSetLoaderOptions */
|
|
13
14
|
/** @typedef {import("../../declarations/WebpackOptions").RuleSetRule} RuleSetRule */
|
|
14
15
|
|
|
@@ -87,6 +88,9 @@ const { SyncHook } = require("tapable");
|
|
|
87
88
|
|
|
88
89
|
/** @typedef {Set<string>} UnhandledProperties */
|
|
89
90
|
|
|
91
|
+
/** @typedef {(data: EffectData) => (RuleSetUseItem | (Falsy | RuleSetUseItem)[])} RuleSetUseFn */
|
|
92
|
+
/** @typedef {(value: string) => boolean} RuleSetConditionFn */
|
|
93
|
+
|
|
90
94
|
/** @typedef {{ apply: (ruleSetCompiler: RuleSetCompiler) => void }} RuleSetPlugin */
|
|
91
95
|
|
|
92
96
|
class RuleSetCompiler {
|
|
@@ -116,6 +120,7 @@ class RuleSetCompiler {
|
|
|
116
120
|
* @returns {RuleSet} compiled RuleSet
|
|
117
121
|
*/
|
|
118
122
|
compile(ruleSet) {
|
|
123
|
+
/** @type {References} */
|
|
119
124
|
const refs = new Map();
|
|
120
125
|
const rules = this.compileRules("ruleSet", ruleSet, refs);
|
|
121
126
|
|
|
@@ -327,6 +332,7 @@ class RuleSetCompiler {
|
|
|
327
332
|
);
|
|
328
333
|
}
|
|
329
334
|
|
|
335
|
+
/** @type {Condition[]} */
|
|
330
336
|
const conditions = [];
|
|
331
337
|
for (const key of Object.keys(condition)) {
|
|
332
338
|
const value = condition[key];
|
|
@@ -26,10 +26,15 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
|
|
|
26
26
|
*/
|
|
27
27
|
constructor(contentType, name, global, getFilenameForChunk, allChunks) {
|
|
28
28
|
super(`get ${name} chunk filename`);
|
|
29
|
+
/** @type {string} */
|
|
29
30
|
this.contentType = contentType;
|
|
31
|
+
/** @type {string} */
|
|
30
32
|
this.global = global;
|
|
33
|
+
/** @type {(chunk: Chunk) => TemplatePath | false} */
|
|
31
34
|
this.getFilenameForChunk = getFilenameForChunk;
|
|
35
|
+
/** @type {boolean} */
|
|
32
36
|
this.allChunks = allChunks;
|
|
37
|
+
/** @type {boolean} */
|
|
33
38
|
this.dependentHash = true;
|
|
34
39
|
}
|
|
35
40
|
|
|
@@ -47,7 +47,9 @@ class LoadScriptRuntimeModule extends HelperRuntimeModule {
|
|
|
47
47
|
*/
|
|
48
48
|
constructor(withCreateScriptUrl, withFetchPriority) {
|
|
49
49
|
super("load script");
|
|
50
|
+
/** @type {boolean | undefined} */
|
|
50
51
|
this._withCreateScriptUrl = withCreateScriptUrl;
|
|
52
|
+
/** @type {boolean | undefined} */
|
|
51
53
|
this._withFetchPriority = withFetchPriority;
|
|
52
54
|
}
|
|
53
55
|
|