webpack 5.59.0 → 5.94.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.
- package/README.md +48 -38
- package/bin/webpack.js +34 -10
- package/hot/dev-server.js +19 -5
- package/hot/lazy-compilation-node.js +13 -1
- package/hot/lazy-compilation-web.js +9 -0
- package/hot/log-apply-result.js +5 -0
- package/hot/log.js +23 -4
- package/hot/only-dev-server.js +3 -2
- package/hot/poll.js +5 -2
- package/hot/signal.js +6 -2
- package/lib/APIPlugin.js +226 -122
- package/lib/AbstractMethodError.js +10 -5
- package/lib/AsyncDependenciesBlock.js +13 -5
- package/lib/AutomaticPrefetchPlugin.js +2 -1
- package/lib/BannerPlugin.js +33 -12
- package/lib/Cache.js +16 -12
- package/lib/CacheFacade.js +13 -16
- package/lib/CaseSensitiveModulesWarning.js +8 -8
- package/lib/Chunk.js +60 -33
- package/lib/ChunkGraph.js +207 -72
- package/lib/ChunkGroup.js +40 -20
- package/lib/ChunkTemplate.js +43 -0
- package/lib/CleanPlugin.js +117 -32
- package/lib/CodeGenerationResults.js +8 -7
- package/lib/CommentCompilationWarning.js +0 -1
- package/lib/CompatibilityPlugin.js +85 -46
- package/lib/Compilation.js +712 -392
- package/lib/Compiler.js +393 -172
- package/lib/ConcatenationScope.js +10 -13
- package/lib/ConditionalInitFragment.js +22 -14
- package/lib/ConstPlugin.js +104 -64
- package/lib/ContextExclusionPlugin.js +3 -3
- package/lib/ContextModule.js +283 -108
- package/lib/ContextModuleFactory.js +151 -63
- package/lib/ContextReplacementPlugin.js +25 -10
- package/lib/CssModule.js +166 -0
- package/lib/DefinePlugin.js +254 -148
- package/lib/DelegatedModule.js +29 -6
- package/lib/DelegatedModuleFactoryPlugin.js +42 -22
- package/lib/DelegatedPlugin.js +4 -0
- package/lib/DependenciesBlock.js +17 -2
- package/lib/Dependency.js +58 -29
- package/lib/DependencyTemplate.js +24 -3
- package/lib/DependencyTemplates.js +2 -2
- package/lib/DllEntryPlugin.js +18 -1
- package/lib/DllModule.js +21 -4
- package/lib/DllModuleFactory.js +2 -1
- package/lib/DllPlugin.js +9 -7
- package/lib/DllReferencePlugin.js +50 -19
- package/lib/EntryOptionPlugin.js +6 -1
- package/lib/EntryPlugin.js +7 -4
- package/lib/Entrypoint.js +2 -2
- package/lib/EnvironmentNotSupportAsyncWarning.js +52 -0
- package/lib/EnvironmentPlugin.js +5 -2
- package/lib/ErrorHelpers.js +65 -26
- package/lib/EvalDevToolModulePlugin.js +37 -13
- package/lib/EvalSourceMapDevToolPlugin.js +50 -20
- package/lib/ExportsInfo.js +234 -133
- package/lib/ExportsInfoApiPlugin.js +31 -15
- package/lib/ExternalModule.js +391 -129
- package/lib/ExternalModuleFactoryPlugin.js +65 -17
- package/lib/FileSystemInfo.js +1038 -523
- package/lib/FlagAllModulesAsUsedPlugin.js +27 -27
- package/lib/FlagDependencyExportsPlugin.js +352 -349
- package/lib/FlagDependencyUsagePlugin.js +10 -10
- package/lib/FlagEntryExportAsUsedPlugin.js +26 -23
- package/lib/Generator.js +16 -8
- package/lib/GraphHelpers.js +3 -2
- package/lib/HookWebpackError.js +11 -13
- package/lib/HotModuleReplacementPlugin.js +221 -128
- package/lib/IgnoreErrorModuleFactory.js +4 -4
- package/lib/IgnorePlugin.js +5 -4
- package/lib/IgnoreWarningsPlugin.js +6 -9
- package/lib/InitFragment.js +39 -15
- package/lib/JavascriptMetaInfoPlugin.js +27 -15
- package/lib/LibManifestPlugin.js +45 -16
- package/lib/LoaderOptionsPlugin.js +13 -3
- package/lib/MainTemplate.js +74 -21
- package/lib/Module.js +155 -34
- package/lib/ModuleBuildError.js +13 -11
- package/lib/ModuleDependencyError.js +6 -4
- package/lib/ModuleDependencyWarning.js +6 -4
- package/lib/ModuleError.js +10 -5
- package/lib/ModuleFactory.js +4 -4
- package/lib/ModuleFilenameHelpers.js +164 -54
- package/lib/ModuleGraph.js +93 -53
- package/lib/ModuleGraphConnection.js +27 -13
- package/lib/ModuleHashingError.js +29 -0
- package/lib/ModuleInfoHeaderPlugin.js +92 -33
- package/lib/ModuleNotFoundError.js +5 -2
- package/lib/ModuleParseError.js +17 -9
- package/lib/ModuleProfile.js +1 -0
- package/lib/ModuleRestoreError.js +3 -1
- package/lib/ModuleStoreError.js +3 -2
- package/lib/ModuleTemplate.js +33 -1
- package/lib/ModuleTypeConstants.js +168 -0
- package/lib/ModuleWarning.js +10 -5
- package/lib/MultiCompiler.js +115 -38
- package/lib/MultiStats.js +75 -33
- package/lib/MultiWatching.js +6 -2
- package/lib/NodeStuffPlugin.js +136 -37
- package/lib/NormalModule.js +437 -194
- package/lib/NormalModuleFactory.js +313 -116
- package/lib/NormalModuleReplacementPlugin.js +10 -4
- package/lib/NullFactory.js +1 -1
- package/lib/OptimizationStages.js +3 -3
- package/lib/Parser.js +1 -1
- package/lib/PlatformPlugin.js +39 -0
- package/lib/PrefetchPlugin.js +4 -0
- package/lib/ProgressPlugin.js +83 -28
- package/lib/ProvidePlugin.js +37 -19
- package/lib/RawModule.js +18 -5
- package/lib/RecordIdsPlugin.js +8 -8
- package/lib/RequireJsStuffPlugin.js +22 -15
- package/lib/ResolverFactory.js +8 -4
- package/lib/RuntimeGlobals.js +99 -65
- package/lib/RuntimeModule.js +17 -15
- package/lib/RuntimePlugin.js +116 -13
- package/lib/RuntimeTemplate.js +304 -102
- package/lib/SelfModuleFactory.js +12 -0
- package/lib/SizeFormatHelpers.js +2 -4
- package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -0
- package/lib/SourceMapDevToolPlugin.js +89 -42
- package/lib/Stats.js +12 -7
- package/lib/Template.js +30 -33
- package/lib/TemplatedPathPlugin.js +102 -34
- package/lib/UseStrictPlugin.js +37 -12
- package/lib/WarnCaseSensitiveModulesPlugin.js +12 -0
- package/lib/WarnDeprecatedOptionPlugin.js +6 -0
- package/lib/WatchIgnorePlugin.js +46 -13
- package/lib/Watching.js +139 -76
- package/lib/WebpackError.js +14 -5
- package/lib/WebpackIsIncludedPlugin.js +22 -13
- package/lib/WebpackOptionsApply.js +162 -56
- package/lib/WebpackOptionsDefaulter.js +10 -3
- package/lib/asset/AssetGenerator.js +351 -99
- package/lib/asset/AssetModulesPlugin.js +57 -33
- package/lib/asset/AssetParser.js +15 -6
- package/lib/asset/AssetSourceGenerator.js +30 -10
- package/lib/asset/AssetSourceParser.js +8 -2
- package/lib/asset/RawDataUrlModule.js +162 -0
- package/lib/async-modules/AwaitDependenciesInitFragment.js +16 -13
- package/lib/async-modules/InferAsyncModulesPlugin.js +1 -1
- package/lib/buildChunkGraph.js +376 -420
- package/lib/cache/AddManagedPathsPlugin.js +6 -1
- package/lib/cache/IdleFileCachePlugin.js +26 -13
- package/lib/cache/MemoryCachePlugin.js +1 -1
- package/lib/cache/MemoryWithGcCachePlugin.js +13 -7
- package/lib/cache/PackFileCacheStrategy.js +172 -94
- package/lib/cache/ResolverCachePlugin.js +115 -43
- package/lib/cache/getLazyHashedEtag.js +2 -2
- package/lib/cache/mergeEtags.js +16 -21
- package/lib/cli.js +195 -110
- package/lib/config/browserslistTargetHandler.js +106 -41
- package/lib/config/defaults.js +572 -154
- package/lib/config/normalization.js +361 -322
- package/lib/config/target.js +105 -66
- package/lib/container/ContainerEntryDependency.js +2 -1
- package/lib/container/ContainerEntryModule.js +27 -11
- package/lib/container/ContainerEntryModuleFactory.js +1 -1
- package/lib/container/ContainerExposedDependency.js +9 -0
- package/lib/container/ContainerPlugin.js +18 -12
- package/lib/container/ContainerReferencePlugin.js +1 -1
- package/lib/container/FallbackDependency.js +13 -0
- package/lib/container/FallbackItemDependency.js +3 -0
- package/lib/container/FallbackModule.js +19 -8
- package/lib/container/FallbackModuleFactory.js +1 -1
- package/lib/container/ModuleFederationPlugin.js +2 -0
- package/lib/container/RemoteModule.js +17 -4
- package/lib/container/RemoteRuntimeModule.js +31 -17
- package/lib/container/RemoteToExternalDependency.js +3 -0
- package/lib/container/options.js +18 -4
- package/lib/css/CssExportsGenerator.js +203 -0
- package/lib/css/CssGenerator.js +151 -0
- package/lib/css/CssLoadingRuntimeModule.js +592 -0
- package/lib/css/CssModulesPlugin.js +888 -0
- package/lib/css/CssParser.js +1049 -0
- package/lib/css/walkCssTokens.js +775 -0
- package/lib/debug/ProfilingPlugin.js +102 -54
- package/lib/dependencies/AMDDefineDependency.js +54 -10
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +204 -61
- package/lib/dependencies/AMDPlugin.js +44 -24
- package/lib/dependencies/AMDRequireArrayDependency.js +34 -10
- package/lib/dependencies/AMDRequireContextDependency.js +15 -0
- package/lib/dependencies/AMDRequireDependenciesBlock.js +6 -0
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +185 -54
- package/lib/dependencies/AMDRequireDependency.js +21 -6
- package/lib/dependencies/AMDRequireItemDependency.js +6 -0
- package/lib/dependencies/AMDRuntimeModules.js +4 -4
- package/lib/dependencies/CachedConstDependency.js +22 -1
- package/lib/dependencies/CommonJsDependencyHelpers.js +16 -2
- package/lib/dependencies/CommonJsExportRequireDependency.js +77 -47
- package/lib/dependencies/CommonJsExportsDependency.js +28 -5
- package/lib/dependencies/CommonJsExportsParserPlugin.js +111 -39
- package/lib/dependencies/CommonJsFullRequireDependency.js +42 -8
- package/lib/dependencies/CommonJsImportsParserPlugin.js +530 -130
- package/lib/dependencies/CommonJsPlugin.js +51 -26
- package/lib/dependencies/CommonJsRequireContextDependency.js +23 -2
- package/lib/dependencies/CommonJsRequireDependency.js +9 -1
- package/lib/dependencies/CommonJsSelfReferenceDependency.js +22 -8
- package/lib/dependencies/ConstDependency.js +12 -3
- package/lib/dependencies/ContextDependency.js +32 -5
- package/lib/dependencies/ContextDependencyHelpers.js +92 -62
- package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +4 -1
- package/lib/dependencies/ContextElementDependency.js +41 -4
- package/lib/dependencies/CreateScriptUrlDependency.js +22 -1
- package/lib/dependencies/CriticalDependencyWarning.js +4 -1
- package/lib/dependencies/CssExportDependency.js +156 -0
- package/lib/dependencies/CssImportDependency.js +125 -0
- package/lib/dependencies/CssLocalIdentifierDependency.js +245 -0
- package/lib/dependencies/CssSelfLocalIdentifierDependency.js +111 -0
- package/lib/dependencies/CssUrlDependency.js +164 -0
- package/lib/dependencies/DelegatedSourceDependency.js +3 -0
- package/lib/dependencies/DllEntryDependency.js +14 -0
- package/lib/dependencies/DynamicExports.js +15 -11
- package/lib/dependencies/ExportsInfoDependency.js +26 -5
- package/lib/dependencies/ExternalModuleDependency.js +109 -0
- package/lib/dependencies/ExternalModuleInitFragment.js +133 -0
- package/lib/dependencies/HarmonyAcceptDependency.js +11 -2
- package/lib/dependencies/HarmonyAcceptImportDependency.js +9 -4
- package/lib/dependencies/HarmonyCompatibilityDependency.js +6 -5
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +29 -3
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +152 -0
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +96 -51
- package/lib/dependencies/HarmonyExportExpressionDependency.js +21 -4
- package/lib/dependencies/HarmonyExportHeaderDependency.js +13 -0
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +216 -108
- package/lib/dependencies/HarmonyExportInitFragment.js +21 -9
- package/lib/dependencies/HarmonyExportSpecifierDependency.js +12 -0
- package/lib/dependencies/HarmonyExports.js +13 -7
- package/lib/dependencies/HarmonyImportDependency.js +65 -19
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +268 -74
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +11 -5
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +180 -36
- package/lib/dependencies/HarmonyModulesPlugin.js +33 -5
- package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +15 -3
- package/lib/dependencies/ImportContextDependency.js +15 -2
- package/lib/dependencies/ImportDependency.js +50 -12
- package/lib/dependencies/ImportEagerDependency.js +11 -6
- package/lib/dependencies/ImportMetaContextDependency.js +42 -0
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +301 -0
- package/lib/dependencies/ImportMetaContextPlugin.js +72 -0
- package/lib/dependencies/ImportMetaHotAcceptDependency.js +6 -0
- package/lib/dependencies/ImportMetaHotDeclineDependency.js +6 -0
- package/lib/dependencies/ImportMetaPlugin.js +128 -59
- package/lib/dependencies/ImportParserPlugin.js +153 -83
- package/lib/dependencies/ImportPlugin.js +21 -7
- package/lib/dependencies/ImportWeakDependency.js +11 -6
- package/lib/dependencies/JsonExportsDependency.js +38 -30
- package/lib/dependencies/LoaderDependency.js +14 -0
- package/lib/dependencies/LoaderImportDependency.js +14 -0
- package/lib/dependencies/LoaderPlugin.js +54 -40
- package/lib/dependencies/LocalModule.js +17 -1
- package/lib/dependencies/LocalModuleDependency.js +15 -0
- package/lib/dependencies/LocalModulesHelpers.js +22 -4
- package/lib/dependencies/ModuleDecoratorDependency.js +9 -1
- package/lib/dependencies/ModuleDependency.js +24 -7
- package/lib/dependencies/ModuleDependencyTemplateAsId.js +2 -1
- package/lib/dependencies/ModuleHotAcceptDependency.js +6 -0
- package/lib/dependencies/ModuleHotDeclineDependency.js +6 -0
- package/lib/dependencies/PrefetchDependency.js +3 -0
- package/lib/dependencies/ProvidedDependency.js +43 -8
- package/lib/dependencies/PureExpressionDependency.js +73 -39
- package/lib/dependencies/RequireContextDependency.js +6 -16
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +14 -6
- package/lib/dependencies/RequireContextPlugin.js +20 -7
- package/lib/dependencies/RequireEnsureDependenciesBlock.js +7 -0
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +29 -12
- package/lib/dependencies/RequireEnsureDependency.js +16 -2
- package/lib/dependencies/RequireEnsureItemDependency.js +3 -0
- package/lib/dependencies/RequireEnsurePlugin.js +27 -7
- package/lib/dependencies/RequireHeaderDependency.js +14 -1
- package/lib/dependencies/RequireIncludeDependency.js +6 -1
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +29 -5
- package/lib/dependencies/RequireIncludePlugin.js +25 -5
- package/lib/dependencies/RequireResolveContextDependency.js +19 -2
- package/lib/dependencies/RequireResolveDependency.js +8 -1
- package/lib/dependencies/RequireResolveHeaderDependency.js +18 -0
- package/lib/dependencies/RuntimeRequirementsDependency.js +9 -1
- package/lib/dependencies/StaticExportsDependency.js +8 -0
- package/lib/dependencies/SystemPlugin.js +49 -22
- package/lib/dependencies/SystemRuntimeModule.js +1 -1
- package/lib/dependencies/URLDependency.js +20 -13
- package/lib/dependencies/URLPlugin.js +115 -27
- package/lib/dependencies/UnsupportedDependency.js +13 -0
- package/lib/dependencies/WebAssemblyExportImportedDependency.js +14 -0
- package/lib/dependencies/WebAssemblyImportDependency.js +9 -1
- package/lib/dependencies/WebpackIsIncludedDependency.js +6 -1
- package/lib/dependencies/WorkerDependency.js +47 -3
- package/lib/dependencies/WorkerPlugin.js +143 -59
- package/lib/dependencies/getFunctionExpression.js +9 -0
- package/lib/dependencies/processExportInfo.js +3 -1
- package/lib/electron/ElectronTargetPlugin.js +1 -0
- package/lib/esm/ExportWebpackRequireRuntimeModule.js +3 -2
- package/lib/esm/ModuleChunkFormatPlugin.js +92 -55
- package/lib/esm/ModuleChunkLoadingPlugin.js +12 -1
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +141 -25
- package/lib/formatLocation.js +1 -2
- package/lib/hmr/HotModuleReplacement.runtime.js +37 -25
- package/lib/hmr/HotModuleReplacementRuntimeModule.js +2 -1
- package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +13 -15
- package/lib/hmr/LazyCompilationPlugin.js +94 -41
- package/lib/hmr/lazyCompilationBackend.js +107 -44
- package/lib/ids/ChunkModuleIdRangePlugin.js +12 -3
- package/lib/ids/DeterministicChunkIdsPlugin.js +13 -6
- package/lib/ids/DeterministicModuleIdsPlugin.js +59 -35
- package/lib/ids/HashedModuleIdsPlugin.js +24 -16
- package/lib/ids/IdHelpers.js +59 -49
- package/lib/ids/NamedChunkIdsPlugin.js +13 -1
- package/lib/ids/NamedModuleIdsPlugin.js +20 -12
- package/lib/ids/NaturalModuleIdsPlugin.js +10 -13
- package/lib/ids/OccurrenceChunkIdsPlugin.js +6 -2
- package/lib/ids/OccurrenceModuleIdsPlugin.js +14 -11
- package/lib/ids/SyncModuleIdsPlugin.js +146 -0
- package/lib/index.js +44 -5
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +9 -7
- package/lib/javascript/BasicEvaluatedExpression.js +133 -19
- package/lib/javascript/ChunkHelpers.js +33 -0
- package/lib/javascript/CommonJsChunkFormatPlugin.js +18 -15
- package/lib/javascript/EnableChunkLoadingPlugin.js +11 -6
- package/lib/javascript/JavascriptGenerator.js +37 -6
- package/lib/javascript/JavascriptModulesPlugin.js +523 -295
- package/lib/javascript/JavascriptParser.js +1591 -574
- package/lib/javascript/JavascriptParserHelpers.js +58 -37
- package/lib/javascript/StartupHelpers.js +69 -47
- package/lib/json/JsonData.js +33 -0
- package/lib/json/JsonGenerator.js +29 -21
- package/lib/json/JsonModulesPlugin.js +13 -7
- package/lib/json/JsonParser.js +30 -16
- package/lib/library/AbstractLibraryPlugin.js +6 -2
- package/lib/library/AmdLibraryPlugin.js +34 -18
- package/lib/library/AssignLibraryPlugin.js +68 -32
- package/lib/library/EnableLibraryPlugin.js +39 -14
- package/lib/library/ExportPropertyLibraryPlugin.js +14 -5
- package/lib/library/JsonpLibraryPlugin.js +4 -3
- package/lib/library/ModernModuleLibraryPlugin.js +144 -0
- package/lib/library/ModuleLibraryPlugin.js +12 -7
- package/lib/library/SystemLibraryPlugin.js +6 -4
- package/lib/library/UmdLibraryPlugin.js +119 -100
- package/lib/logging/Logger.js +59 -6
- package/lib/logging/createConsoleLogger.js +25 -40
- package/lib/logging/runtime.js +8 -9
- package/lib/logging/truncateArgs.js +9 -8
- package/lib/node/CommonJsChunkLoadingPlugin.js +18 -2
- package/lib/node/NodeEnvironmentPlugin.js +14 -8
- package/lib/node/NodeTargetPlugin.js +7 -0
- package/lib/node/NodeTemplatePlugin.js +10 -2
- package/lib/node/NodeWatchFileSystem.js +100 -50
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +51 -26
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +13 -2
- package/lib/node/ReadFileCompileWasmPlugin.js +21 -3
- package/lib/node/RequireChunkLoadingRuntimeModule.js +49 -26
- package/lib/node/nodeConsole.js +48 -31
- package/lib/optimize/AggressiveMergingPlugin.js +10 -4
- package/lib/optimize/AggressiveSplittingPlugin.js +26 -21
- package/lib/optimize/ConcatenatedModule.js +353 -212
- package/lib/optimize/EnsureChunkConditionsPlugin.js +4 -1
- package/lib/optimize/FlagIncludedChunksPlugin.js +14 -8
- package/lib/optimize/InnerGraph.js +30 -25
- package/lib/optimize/InnerGraphPlugin.js +105 -64
- package/lib/optimize/LimitChunkCountPlugin.js +32 -9
- package/lib/optimize/MangleExportsPlugin.js +7 -2
- package/lib/optimize/MinMaxSizeWarning.js +6 -1
- package/lib/optimize/ModuleConcatenationPlugin.js +150 -83
- package/lib/optimize/RealContentHashPlugin.js +99 -43
- package/lib/optimize/RemoveParentModulesPlugin.js +131 -48
- package/lib/optimize/RuntimeChunkPlugin.js +15 -2
- package/lib/optimize/SideEffectsFlagPlugin.js +119 -63
- package/lib/optimize/SplitChunksPlugin.js +129 -78
- package/lib/performance/SizeLimitsPlugin.js +22 -8
- package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +4 -2
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +4 -1
- package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +8 -5
- package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +5 -3
- package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +5 -3
- package/lib/rules/BasicEffectRulePlugin.js +7 -1
- package/lib/rules/BasicMatcherRulePlugin.js +8 -1
- package/lib/rules/ObjectMatcherRulePlugin.js +19 -2
- package/lib/rules/RuleSetCompiler.js +53 -32
- package/lib/rules/UseEffectRulePlugin.js +42 -36
- package/lib/runtime/AsyncModuleRuntimeModule.js +56 -69
- package/lib/runtime/AutoPublicPathRuntimeModule.js +25 -9
- package/lib/runtime/BaseUriRuntimeModule.js +35 -0
- package/lib/runtime/ChunkNameRuntimeModule.js +1 -1
- package/lib/runtime/CompatGetDefaultExportRuntimeModule.js +5 -2
- package/lib/runtime/CompatRuntimeModule.js +7 -2
- package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +7 -4
- package/lib/runtime/CreateScriptRuntimeModule.js +38 -0
- package/lib/runtime/CreateScriptUrlRuntimeModule.js +13 -36
- package/lib/runtime/DefinePropertyGettersRuntimeModule.js +6 -3
- package/lib/runtime/EnsureChunkRuntimeModule.js +29 -15
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +56 -43
- package/lib/runtime/GetFullHashRuntimeModule.js +4 -3
- package/lib/runtime/GetMainFilenameRuntimeModule.js +5 -2
- package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +98 -0
- package/lib/runtime/GlobalRuntimeModule.js +1 -1
- package/lib/runtime/HasOwnPropertyRuntimeModule.js +5 -2
- package/lib/runtime/LoadScriptRuntimeModule.js +61 -45
- package/lib/runtime/MakeNamespaceObjectRuntimeModule.js +5 -2
- package/lib/runtime/NonceRuntimeModule.js +24 -0
- package/lib/runtime/OnChunksLoadedRuntimeModule.js +4 -2
- package/lib/runtime/PublicPathRuntimeModule.js +9 -2
- package/lib/runtime/RelativeUrlRuntimeModule.js +5 -2
- package/lib/runtime/RuntimeIdRuntimeModule.js +6 -2
- package/lib/runtime/StartupChunkDependenciesPlugin.js +15 -0
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +36 -28
- package/lib/runtime/StartupEntrypointRuntimeModule.js +13 -9
- package/lib/runtime/SystemContextRuntimeModule.js +1 -1
- package/lib/schemes/DataUriPlugin.js +16 -3
- package/lib/schemes/HttpUriPlugin.js +336 -120
- package/lib/serialization/ArraySerializer.js +22 -6
- package/lib/serialization/BinaryMiddleware.js +212 -33
- package/lib/serialization/DateObjectSerializer.js +16 -4
- package/lib/serialization/ErrorObjectSerializer.js +23 -6
- package/lib/serialization/FileMiddleware.js +187 -86
- package/lib/serialization/MapObjectSerializer.js +25 -8
- package/lib/serialization/NullPrototypeObjectSerializer.js +26 -8
- package/lib/serialization/ObjectMiddleware.js +96 -66
- package/lib/serialization/PlainObjectSerializer.js +51 -14
- package/lib/serialization/RegExpObjectSerializer.js +17 -5
- package/lib/serialization/Serializer.js +23 -5
- package/lib/serialization/SerializerMiddleware.js +8 -8
- package/lib/serialization/SetObjectSerializer.js +22 -6
- package/lib/serialization/SingleItemMiddleware.js +2 -2
- package/lib/serialization/types.js +2 -2
- package/lib/sharing/ConsumeSharedFallbackDependency.js +3 -0
- package/lib/sharing/ConsumeSharedModule.js +40 -17
- package/lib/sharing/ConsumeSharedPlugin.js +139 -102
- package/lib/sharing/ConsumeSharedRuntimeModule.js +144 -130
- package/lib/sharing/ProvideForSharedDependency.js +0 -1
- package/lib/sharing/ProvideSharedDependency.js +17 -0
- package/lib/sharing/ProvideSharedModule.js +19 -6
- package/lib/sharing/ProvideSharedModuleFactory.js +1 -1
- package/lib/sharing/ProvideSharedPlugin.js +37 -30
- package/lib/sharing/SharePlugin.js +2 -2
- package/lib/sharing/ShareRuntimeModule.js +20 -10
- package/lib/sharing/resolveMatchedConfigs.js +6 -5
- package/lib/sharing/utils.js +338 -34
- package/lib/stats/DefaultStatsFactoryPlugin.js +660 -396
- package/lib/stats/DefaultStatsPresetPlugin.js +85 -25
- package/lib/stats/DefaultStatsPrinterPlugin.js +525 -145
- package/lib/stats/StatsFactory.js +128 -57
- package/lib/stats/StatsPrinter.js +77 -46
- package/lib/util/ArrayHelpers.js +35 -1
- package/lib/util/ArrayQueue.js +15 -22
- package/lib/util/AsyncQueue.js +37 -16
- package/lib/util/IterableHelpers.js +3 -4
- package/lib/util/LazyBucketSortedSet.js +60 -44
- package/lib/util/LazySet.js +11 -2
- package/lib/util/MapHelpers.js +17 -5
- package/lib/util/ParallelismFactorCalculator.js +11 -1
- package/lib/util/Queue.js +9 -3
- package/lib/util/Semaphore.js +4 -7
- package/lib/util/SetHelpers.js +5 -5
- package/lib/util/SortableSet.js +19 -6
- package/lib/util/StackedCacheMap.js +33 -3
- package/lib/util/StackedMap.js +1 -3
- package/lib/util/StringXor.js +46 -0
- package/lib/util/TupleQueue.js +9 -3
- package/lib/util/TupleSet.js +15 -5
- package/lib/util/URLAbsoluteSpecifier.js +8 -8
- package/lib/util/WeakTupleMap.js +70 -28
- package/lib/util/binarySearchBounds.js +51 -9
- package/lib/util/chainedImports.js +97 -0
- package/lib/util/cleverMerge.js +51 -36
- package/lib/util/comparators.js +146 -83
- package/lib/util/compileBooleanMatcher.js +35 -7
- package/lib/util/conventions.js +126 -0
- package/lib/util/create-schema-validation.js +9 -2
- package/lib/util/createHash.js +49 -14
- package/lib/util/deprecation.js +48 -15
- package/lib/util/deterministicGrouping.js +71 -39
- package/lib/util/extractUrlAndGlobal.js +3 -0
- package/lib/util/findGraphRoots.js +7 -5
- package/lib/util/fs.js +419 -94
- package/lib/util/hash/BatchedHash.js +10 -4
- package/lib/util/hash/md4.js +20 -0
- package/lib/util/hash/wasm-hash.js +163 -0
- package/lib/util/hash/xxhash64.js +7 -141
- package/lib/util/identifier.js +140 -93
- package/lib/util/internalSerializables.js +22 -0
- package/lib/util/makeSerializable.js +7 -0
- package/lib/util/memoize.js +10 -10
- package/lib/util/mergeScope.js +76 -0
- package/lib/util/nonNumericOnlyHash.js +22 -0
- package/lib/util/numberHash.js +84 -34
- package/lib/util/objectToMap.js +0 -1
- package/lib/util/processAsyncTree.js +7 -1
- package/lib/util/propertyAccess.js +7 -55
- package/lib/util/propertyName.js +77 -0
- package/lib/util/registerExternalSerializer.js +2 -2
- package/lib/util/runtime.js +188 -133
- package/lib/util/semver.js +64 -56
- package/lib/util/serialization.js +26 -1
- package/lib/util/smartGrouping.js +10 -10
- package/lib/util/source.js +1 -1
- package/lib/validateSchema.js +6 -2
- package/lib/wasm/EnableWasmLoadingPlugin.js +9 -4
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +70 -30
- package/lib/wasm-async/AsyncWebAssemblyGenerator.js +9 -1
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +34 -16
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +32 -12
- package/lib/wasm-async/AsyncWebAssemblyParser.js +17 -4
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +72 -31
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +17 -6
- package/lib/wasm-sync/WebAssemblyGenerator.js +72 -52
- package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +5 -4
- package/lib/wasm-sync/WebAssemblyModulesPlugin.js +53 -43
- package/lib/wasm-sync/WebAssemblyParser.js +23 -9
- package/lib/wasm-sync/WebAssemblyUtils.js +5 -4
- package/lib/web/FetchCompileAsyncWasmPlugin.js +11 -1
- package/lib/web/FetchCompileWasmPlugin.js +59 -42
- package/lib/web/JsonpChunkLoadingPlugin.js +9 -0
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +71 -41
- package/lib/webpack.js +43 -12
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +15 -12
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +55 -40
- package/module.d.ts +233 -0
- package/package.json +85 -139
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +679 -47
- package/schemas/plugins/BannerPlugin.check.js +1 -1
- package/schemas/plugins/BannerPlugin.json +9 -1
- package/schemas/plugins/DllReferencePlugin.check.js +1 -1
- package/schemas/plugins/HashedModuleIdsPlugin.check.js +1 -1
- package/schemas/plugins/ProgressPlugin.check.js +1 -1
- package/schemas/plugins/SourceMapDevToolPlugin.check.js +1 -1
- package/schemas/plugins/SourceMapDevToolPlugin.json +4 -0
- package/schemas/plugins/asset/AssetGeneratorOptions.check.js +1 -1
- package/schemas/plugins/asset/AssetInlineGeneratorOptions.check.js +1 -1
- package/schemas/plugins/asset/AssetParserOptions.check.js +1 -1
- package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.js +1 -1
- package/schemas/plugins/container/ContainerPlugin.check.js +1 -1
- package/schemas/plugins/container/ContainerPlugin.json +10 -1
- package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
- package/schemas/plugins/container/ContainerReferencePlugin.json +2 -0
- package/schemas/plugins/container/ExternalsType.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.json +12 -1
- package/schemas/plugins/css/CssAutoGeneratorOptions.check.d.ts +7 -0
- package/schemas/plugins/css/CssAutoGeneratorOptions.check.js +6 -0
- package/schemas/plugins/css/CssAutoGeneratorOptions.json +3 -0
- package/schemas/plugins/css/CssAutoParserOptions.check.d.ts +7 -0
- package/schemas/plugins/css/CssAutoParserOptions.check.js +6 -0
- package/schemas/plugins/css/CssAutoParserOptions.json +3 -0
- package/schemas/plugins/css/CssGeneratorOptions.check.d.ts +7 -0
- package/schemas/plugins/css/CssGeneratorOptions.check.js +6 -0
- package/schemas/plugins/css/CssGeneratorOptions.json +3 -0
- package/schemas/plugins/css/CssGlobalGeneratorOptions.check.d.ts +7 -0
- package/schemas/plugins/css/CssGlobalGeneratorOptions.check.js +6 -0
- package/schemas/plugins/css/CssGlobalGeneratorOptions.json +3 -0
- package/schemas/plugins/css/CssGlobalParserOptions.check.d.ts +7 -0
- package/schemas/plugins/css/CssGlobalParserOptions.check.js +6 -0
- package/schemas/plugins/css/CssGlobalParserOptions.json +3 -0
- package/schemas/plugins/css/CssModuleGeneratorOptions.check.d.ts +7 -0
- package/schemas/plugins/css/CssModuleGeneratorOptions.check.js +6 -0
- package/schemas/plugins/css/CssModuleGeneratorOptions.json +3 -0
- package/schemas/plugins/css/CssModuleParserOptions.check.d.ts +7 -0
- package/schemas/plugins/css/CssModuleParserOptions.check.js +6 -0
- package/schemas/plugins/css/CssModuleParserOptions.json +3 -0
- package/schemas/plugins/css/CssParserOptions.check.d.ts +7 -0
- package/schemas/plugins/css/CssParserOptions.check.js +6 -0
- package/schemas/plugins/css/CssParserOptions.json +3 -0
- package/schemas/plugins/optimize/AggressiveSplittingPlugin.check.js +1 -1
- package/schemas/plugins/optimize/LimitChunkCountPlugin.check.js +1 -1
- package/schemas/plugins/optimize/MinChunkSizePlugin.check.js +1 -1
- package/schemas/plugins/schemes/HttpUriPlugin.check.js +1 -1
- package/schemas/plugins/schemes/HttpUriPlugin.json +4 -0
- package/schemas/plugins/sharing/SharePlugin.check.js +1 -1
- package/types.d.ts +5026 -1756
package/lib/ChunkGraph.js
CHANGED
@@ -30,9 +30,11 @@ const {
|
|
30
30
|
|
31
31
|
/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */
|
32
32
|
/** @typedef {import("./Chunk")} Chunk */
|
33
|
+
/** @typedef {import("./Chunk").ChunkId} ChunkId */
|
33
34
|
/** @typedef {import("./ChunkGroup")} ChunkGroup */
|
34
35
|
/** @typedef {import("./Module")} Module */
|
35
36
|
/** @typedef {import("./ModuleGraph")} ModuleGraph */
|
37
|
+
/** @typedef {import("./ModuleGraphConnection").ConnectionState} ConnectionState */
|
36
38
|
/** @typedef {import("./RuntimeModule")} RuntimeModule */
|
37
39
|
/** @typedef {typeof import("./util/Hash")} Hash */
|
38
40
|
/** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */
|
@@ -46,14 +48,19 @@ const compareModuleIterables = compareIterables(compareModulesByIdentifier);
|
|
46
48
|
|
47
49
|
/** @typedef {(c: Chunk, chunkGraph: ChunkGraph) => boolean} ChunkFilterPredicate */
|
48
50
|
/** @typedef {(m: Module) => boolean} ModuleFilterPredicate */
|
51
|
+
/** @typedef {[Module, Entrypoint | undefined]} EntryModuleWithChunkGroup */
|
49
52
|
|
50
53
|
/**
|
51
|
-
* @typedef {
|
54
|
+
* @typedef {object} ChunkSizeOptions
|
52
55
|
* @property {number=} chunkOverhead constant overhead for a chunk
|
53
56
|
* @property {number=} entryChunkMultiplicator multiplicator for initial chunks
|
54
57
|
*/
|
55
58
|
|
56
59
|
class ModuleHashInfo {
|
60
|
+
/**
|
61
|
+
* @param {string} hash hash
|
62
|
+
* @param {string} renderedHash rendered hash
|
63
|
+
*/
|
57
64
|
constructor(hash, renderedHash) {
|
58
65
|
this.hash = hash;
|
59
66
|
this.renderedHash = renderedHash;
|
@@ -67,9 +74,7 @@ class ModuleHashInfo {
|
|
67
74
|
* @param {SortableSet<T>} set the set
|
68
75
|
* @returns {T[]} set as array
|
69
76
|
*/
|
70
|
-
const getArray = set =>
|
71
|
-
return Array.from(set);
|
72
|
-
};
|
77
|
+
const getArray = set => Array.from(set);
|
73
78
|
|
74
79
|
/**
|
75
80
|
* @param {SortableSet<Chunk>} chunks the chunks
|
@@ -84,14 +89,17 @@ const getModuleRuntimes = chunks => {
|
|
84
89
|
};
|
85
90
|
|
86
91
|
/**
|
87
|
-
* @param {
|
88
|
-
* @returns {Map<string, SortableSet<Module>>} modules by source type
|
92
|
+
* @param {WeakMap<Module, Set<string>> | undefined} sourceTypesByModule sourceTypesByModule
|
93
|
+
* @returns {function (SortableSet<Module>): Map<string, SortableSet<Module>>} modules by source type
|
89
94
|
*/
|
90
|
-
const modulesBySourceType = set => {
|
95
|
+
const modulesBySourceType = sourceTypesByModule => set => {
|
91
96
|
/** @type {Map<string, SortableSet<Module>>} */
|
92
97
|
const map = new Map();
|
93
98
|
for (const module of set) {
|
94
|
-
|
99
|
+
const sourceTypes =
|
100
|
+
(sourceTypesByModule && sourceTypesByModule.get(module)) ||
|
101
|
+
module.getSourceTypes();
|
102
|
+
for (const sourceType of sourceTypes) {
|
95
103
|
let innerSet = map.get(sourceType);
|
96
104
|
if (innerSet === undefined) {
|
97
105
|
innerSet = new SortableSet();
|
@@ -109,6 +117,7 @@ const modulesBySourceType = set => {
|
|
109
117
|
}
|
110
118
|
return map;
|
111
119
|
};
|
120
|
+
const defaultModulesBySourceType = modulesBySourceType(undefined);
|
112
121
|
|
113
122
|
/** @type {WeakMap<Function, any>} */
|
114
123
|
const createOrderedArrayFunctionMap = new WeakMap();
|
@@ -149,7 +158,7 @@ const getModulesSize = modules => {
|
|
149
158
|
* @returns {Record<string, number>} the sizes of the modules
|
150
159
|
*/
|
151
160
|
const getModulesSizes = modules => {
|
152
|
-
|
161
|
+
const sizes = Object.create(null);
|
153
162
|
for (const module of modules) {
|
154
163
|
for (const type of module.getSourceTypes()) {
|
155
164
|
sizes[type] = (sizes[type] || 0) + module.size(type);
|
@@ -175,23 +184,27 @@ const isAvailableChunk = (a, b) => {
|
|
175
184
|
return true;
|
176
185
|
};
|
177
186
|
|
187
|
+
/** @typedef {Set<Chunk>} EntryInChunks */
|
188
|
+
/** @typedef {Set<Chunk>} RuntimeInChunks */
|
189
|
+
/** @typedef {string | number} ModuleId */
|
190
|
+
|
178
191
|
class ChunkGraphModule {
|
179
192
|
constructor() {
|
180
193
|
/** @type {SortableSet<Chunk>} */
|
181
194
|
this.chunks = new SortableSet();
|
182
|
-
/** @type {
|
195
|
+
/** @type {EntryInChunks | undefined} */
|
183
196
|
this.entryInChunks = undefined;
|
184
|
-
/** @type {
|
197
|
+
/** @type {RuntimeInChunks | undefined} */
|
185
198
|
this.runtimeInChunks = undefined;
|
186
|
-
/** @type {RuntimeSpecMap<ModuleHashInfo>} */
|
199
|
+
/** @type {RuntimeSpecMap<ModuleHashInfo> | undefined} */
|
187
200
|
this.hashes = undefined;
|
188
|
-
/** @type {
|
201
|
+
/** @type {ModuleId | null} */
|
189
202
|
this.id = null;
|
190
203
|
/** @type {RuntimeSpecMap<Set<string>> | undefined} */
|
191
204
|
this.runtimeRequirements = undefined;
|
192
|
-
/** @type {RuntimeSpecMap<string>} */
|
205
|
+
/** @type {RuntimeSpecMap<string> | undefined} */
|
193
206
|
this.graphHashes = undefined;
|
194
|
-
/** @type {RuntimeSpecMap<string>} */
|
207
|
+
/** @type {RuntimeSpecMap<string> | undefined} */
|
195
208
|
this.graphHashesWithConnections = undefined;
|
196
209
|
}
|
197
210
|
}
|
@@ -200,6 +213,8 @@ class ChunkGraphChunk {
|
|
200
213
|
constructor() {
|
201
214
|
/** @type {SortableSet<Module>} */
|
202
215
|
this.modules = new SortableSet();
|
216
|
+
/** @type {WeakMap<Module, Set<string>> | undefined} */
|
217
|
+
this.sourceTypesByModule = undefined;
|
203
218
|
/** @type {Map<Module, Entrypoint>} */
|
204
219
|
this.entryModules = new Map();
|
205
220
|
/** @type {SortableSet<RuntimeModule>} */
|
@@ -212,6 +227,8 @@ class ChunkGraphChunk {
|
|
212
227
|
this.runtimeRequirements = undefined;
|
213
228
|
/** @type {Set<string>} */
|
214
229
|
this.runtimeRequirementsInTree = new Set();
|
230
|
+
|
231
|
+
this._modulesBySourceType = defaultModulesBySourceType;
|
215
232
|
}
|
216
233
|
}
|
217
234
|
|
@@ -221,13 +238,25 @@ class ChunkGraph {
|
|
221
238
|
* @param {string | Hash} hashFunction the hash function to use
|
222
239
|
*/
|
223
240
|
constructor(moduleGraph, hashFunction = "md4") {
|
224
|
-
/**
|
241
|
+
/**
|
242
|
+
* @private
|
243
|
+
* @type {WeakMap<Module, ChunkGraphModule>}
|
244
|
+
*/
|
225
245
|
this._modules = new WeakMap();
|
226
|
-
/**
|
246
|
+
/**
|
247
|
+
* @private
|
248
|
+
* @type {WeakMap<Chunk, ChunkGraphChunk>}
|
249
|
+
*/
|
227
250
|
this._chunks = new WeakMap();
|
228
|
-
/**
|
251
|
+
/**
|
252
|
+
* @private
|
253
|
+
* @type {WeakMap<AsyncDependenciesBlock, ChunkGroup>}
|
254
|
+
*/
|
229
255
|
this._blockChunkGroups = new WeakMap();
|
230
|
-
/**
|
256
|
+
/**
|
257
|
+
* @private
|
258
|
+
* @type {Map<string, string | number>}
|
259
|
+
*/
|
231
260
|
this._runtimeIds = new Map();
|
232
261
|
/** @type {ModuleGraph} */
|
233
262
|
this.moduleGraph = moduleGraph;
|
@@ -275,6 +304,9 @@ class ChunkGraph {
|
|
275
304
|
findGraphRoots(set, module => {
|
276
305
|
/** @type {Set<Module>} */
|
277
306
|
const set = new Set();
|
307
|
+
/**
|
308
|
+
* @param {Module} module module
|
309
|
+
*/
|
278
310
|
const addDependencies = module => {
|
279
311
|
for (const connection of moduleGraph.getOutgoingConnections(module)) {
|
280
312
|
if (!connection.module) continue;
|
@@ -314,6 +346,8 @@ class ChunkGraph {
|
|
314
346
|
const cgm = this._getChunkGraphModule(module);
|
315
347
|
const cgc = this._getChunkGraphChunk(chunk);
|
316
348
|
cgc.modules.delete(module);
|
349
|
+
// No need to invalidate cgc._modulesBySourceType because we modified cgc.modules anyway
|
350
|
+
if (cgc.sourceTypesByModule) cgc.sourceTypesByModule.delete(module);
|
317
351
|
cgm.chunks.delete(chunk);
|
318
352
|
}
|
319
353
|
|
@@ -406,7 +440,7 @@ class ChunkGraph {
|
|
406
440
|
}
|
407
441
|
for (const chunk of oldCgm.entryInChunks) {
|
408
442
|
const cgc = this._getChunkGraphChunk(chunk);
|
409
|
-
const old = cgc.entryModules.get(oldModule);
|
443
|
+
const old = /** @type {Entrypoint} */ (cgc.entryModules.get(oldModule));
|
410
444
|
/** @type {Map<Module, Entrypoint>} */
|
411
445
|
const newEntryModules = new Map();
|
412
446
|
for (const [m, cg] of cgc.entryModules) {
|
@@ -567,11 +601,84 @@ class ChunkGraph {
|
|
567
601
|
getChunkModulesIterableBySourceType(chunk, sourceType) {
|
568
602
|
const cgc = this._getChunkGraphChunk(chunk);
|
569
603
|
const modulesWithSourceType = cgc.modules
|
570
|
-
.getFromUnorderedCache(
|
604
|
+
.getFromUnorderedCache(cgc._modulesBySourceType)
|
571
605
|
.get(sourceType);
|
572
606
|
return modulesWithSourceType;
|
573
607
|
}
|
574
608
|
|
609
|
+
/**
|
610
|
+
* @param {Chunk} chunk chunk
|
611
|
+
* @param {Module} module chunk module
|
612
|
+
* @param {Set<string>} sourceTypes source types
|
613
|
+
*/
|
614
|
+
setChunkModuleSourceTypes(chunk, module, sourceTypes) {
|
615
|
+
const cgc = this._getChunkGraphChunk(chunk);
|
616
|
+
if (cgc.sourceTypesByModule === undefined) {
|
617
|
+
cgc.sourceTypesByModule = new WeakMap();
|
618
|
+
}
|
619
|
+
cgc.sourceTypesByModule.set(module, sourceTypes);
|
620
|
+
// Update cgc._modulesBySourceType to invalidate the cache
|
621
|
+
cgc._modulesBySourceType = modulesBySourceType(cgc.sourceTypesByModule);
|
622
|
+
}
|
623
|
+
|
624
|
+
/**
|
625
|
+
* @param {Chunk} chunk chunk
|
626
|
+
* @param {Module} module chunk module
|
627
|
+
* @returns {Set<string>} source types
|
628
|
+
*/
|
629
|
+
getChunkModuleSourceTypes(chunk, module) {
|
630
|
+
const cgc = this._getChunkGraphChunk(chunk);
|
631
|
+
if (cgc.sourceTypesByModule === undefined) {
|
632
|
+
return module.getSourceTypes();
|
633
|
+
}
|
634
|
+
return cgc.sourceTypesByModule.get(module) || module.getSourceTypes();
|
635
|
+
}
|
636
|
+
|
637
|
+
/**
|
638
|
+
* @param {Module} module module
|
639
|
+
* @returns {Set<string>} source types
|
640
|
+
*/
|
641
|
+
getModuleSourceTypes(module) {
|
642
|
+
return (
|
643
|
+
this._getOverwrittenModuleSourceTypes(module) || module.getSourceTypes()
|
644
|
+
);
|
645
|
+
}
|
646
|
+
|
647
|
+
/**
|
648
|
+
* @param {Module} module module
|
649
|
+
* @returns {Set<string> | undefined} source types
|
650
|
+
*/
|
651
|
+
_getOverwrittenModuleSourceTypes(module) {
|
652
|
+
let newSet = false;
|
653
|
+
let sourceTypes;
|
654
|
+
for (const chunk of this.getModuleChunksIterable(module)) {
|
655
|
+
const cgc = this._getChunkGraphChunk(chunk);
|
656
|
+
if (cgc.sourceTypesByModule === undefined) return;
|
657
|
+
const st = cgc.sourceTypesByModule.get(module);
|
658
|
+
if (st === undefined) return;
|
659
|
+
if (!sourceTypes) {
|
660
|
+
sourceTypes = st;
|
661
|
+
continue;
|
662
|
+
} else if (!newSet) {
|
663
|
+
for (const type of st) {
|
664
|
+
if (!newSet) {
|
665
|
+
if (!sourceTypes.has(type)) {
|
666
|
+
newSet = true;
|
667
|
+
sourceTypes = new Set(sourceTypes);
|
668
|
+
sourceTypes.add(type);
|
669
|
+
}
|
670
|
+
} else {
|
671
|
+
sourceTypes.add(type);
|
672
|
+
}
|
673
|
+
}
|
674
|
+
} else {
|
675
|
+
for (const type of st) sourceTypes.add(type);
|
676
|
+
}
|
677
|
+
}
|
678
|
+
|
679
|
+
return sourceTypes;
|
680
|
+
}
|
681
|
+
|
575
682
|
/**
|
576
683
|
* @param {Chunk} chunk the chunk
|
577
684
|
* @param {function(Module, Module): -1|0|1} comparator comparator function
|
@@ -592,9 +699,9 @@ class ChunkGraph {
|
|
592
699
|
getOrderedChunkModulesIterableBySourceType(chunk, sourceType, comparator) {
|
593
700
|
const cgc = this._getChunkGraphChunk(chunk);
|
594
701
|
const modulesWithSourceType = cgc.modules
|
595
|
-
.getFromUnorderedCache(
|
702
|
+
.getFromUnorderedCache(cgc._modulesBySourceType)
|
596
703
|
.get(sourceType);
|
597
|
-
if (modulesWithSourceType === undefined) return
|
704
|
+
if (modulesWithSourceType === undefined) return;
|
598
705
|
modulesWithSourceType.sortWith(comparator);
|
599
706
|
return modulesWithSourceType;
|
600
707
|
}
|
@@ -632,7 +739,7 @@ class ChunkGraph {
|
|
632
739
|
for (const asyncChunk of includeAllChunks
|
633
740
|
? chunk.getAllReferencedChunks()
|
634
741
|
: chunk.getAllAsyncChunks()) {
|
635
|
-
/** @type {(string|number)[]} */
|
742
|
+
/** @type {(string | number)[] | undefined} */
|
636
743
|
let array;
|
637
744
|
for (const module of this.getOrderedChunkModulesIterable(
|
638
745
|
asyncChunk,
|
@@ -641,9 +748,9 @@ class ChunkGraph {
|
|
641
748
|
if (filterFn(module)) {
|
642
749
|
if (array === undefined) {
|
643
750
|
array = [];
|
644
|
-
chunkModuleIdMap[asyncChunk.id] = array;
|
751
|
+
chunkModuleIdMap[/** @type {ChunkId} */ (asyncChunk.id)] = array;
|
645
752
|
}
|
646
|
-
const moduleId = this.getModuleId(module);
|
753
|
+
const moduleId = /** @type {ModuleId} */ (this.getModuleId(module));
|
647
754
|
array.push(moduleId);
|
648
755
|
}
|
649
756
|
}
|
@@ -665,13 +772,15 @@ class ChunkGraph {
|
|
665
772
|
hashLength = 0,
|
666
773
|
includeAllChunks = false
|
667
774
|
) {
|
668
|
-
/** @type {Record<
|
775
|
+
/** @type {Record<ChunkId, Record<string|number, string>>} */
|
669
776
|
const chunkModuleHashMap = Object.create(null);
|
670
777
|
|
778
|
+
/** @typedef {Record<string|number, string>} IdToHashMap */
|
779
|
+
|
671
780
|
for (const asyncChunk of includeAllChunks
|
672
781
|
? chunk.getAllReferencedChunks()
|
673
782
|
: chunk.getAllAsyncChunks()) {
|
674
|
-
/** @type {
|
783
|
+
/** @type {IdToHashMap | undefined} */
|
675
784
|
let idToHashMap;
|
676
785
|
for (const module of this.getOrderedChunkModulesIterable(
|
677
786
|
asyncChunk,
|
@@ -680,11 +789,15 @@ class ChunkGraph {
|
|
680
789
|
if (filterFn(module)) {
|
681
790
|
if (idToHashMap === undefined) {
|
682
791
|
idToHashMap = Object.create(null);
|
683
|
-
chunkModuleHashMap[asyncChunk.id] =
|
792
|
+
chunkModuleHashMap[/** @type {ChunkId} */ (asyncChunk.id)] =
|
793
|
+
/** @type {IdToHashMap} */ (idToHashMap);
|
684
794
|
}
|
685
795
|
const moduleId = this.getModuleId(module);
|
686
796
|
const hash = this.getRenderedModuleHash(module, asyncChunk.runtime);
|
687
|
-
|
797
|
+
/** @type {IdToHashMap} */
|
798
|
+
(idToHashMap)[/** @type {ModuleId} */ (moduleId)] = hashLength
|
799
|
+
? hash.slice(0, hashLength)
|
800
|
+
: hash;
|
688
801
|
}
|
689
802
|
}
|
690
803
|
}
|
@@ -700,7 +813,7 @@ class ChunkGraph {
|
|
700
813
|
getChunkConditionMap(chunk, filterFn) {
|
701
814
|
const map = Object.create(null);
|
702
815
|
for (const c of chunk.getAllReferencedChunks()) {
|
703
|
-
map[c.id] = filterFn(c, this);
|
816
|
+
map[/** @type {ChunkId} */ (c.id)] = filterFn(c, this);
|
704
817
|
}
|
705
818
|
return map;
|
706
819
|
}
|
@@ -808,7 +921,7 @@ class ChunkGraph {
|
|
808
921
|
const cgcB = this._getChunkGraphChunk(chunkB);
|
809
922
|
const allModules = new Set(cgcA.modules);
|
810
923
|
for (const m of cgcB.modules) allModules.add(m);
|
811
|
-
|
924
|
+
const modulesSize = getModulesSize(allModules);
|
812
925
|
const chunkOverhead =
|
813
926
|
typeof options.chunkOverhead === "number" ? options.chunkOverhead : 10000;
|
814
927
|
const entryChunkMultiplicator =
|
@@ -842,9 +955,9 @@ class ChunkGraph {
|
|
842
955
|
return isAvailableChunk(chunkA, chunkB);
|
843
956
|
} else if (hasRuntimeB) {
|
844
957
|
return isAvailableChunk(chunkB, chunkA);
|
845
|
-
} else {
|
846
|
-
return false;
|
847
958
|
}
|
959
|
+
|
960
|
+
return false;
|
848
961
|
}
|
849
962
|
|
850
963
|
if (
|
@@ -903,7 +1016,12 @@ class ChunkGraph {
|
|
903
1016
|
this.getChunkEntryModulesWithChunkGroupIterable(chunkB)
|
904
1017
|
)) {
|
905
1018
|
this.disconnectChunkAndEntryModule(chunkB, module);
|
906
|
-
this.connectChunkAndEntryModule(
|
1019
|
+
this.connectChunkAndEntryModule(
|
1020
|
+
chunkA,
|
1021
|
+
module,
|
1022
|
+
/** @type {Entrypoint} */
|
1023
|
+
(chunkGroup)
|
1024
|
+
);
|
907
1025
|
}
|
908
1026
|
|
909
1027
|
for (const chunkGroup of chunkB.groupsIterable) {
|
@@ -944,7 +1062,7 @@ class ChunkGraph {
|
|
944
1062
|
/**
|
945
1063
|
* @param {Chunk} chunk the new chunk
|
946
1064
|
* @param {Module} module the entry module
|
947
|
-
* @param {Entrypoint
|
1065
|
+
* @param {Entrypoint} entrypoint the chunk group which must be loaded before the module is executed
|
948
1066
|
* @returns {void}
|
949
1067
|
*/
|
950
1068
|
connectChunkAndEntryModule(chunk, module, entrypoint) {
|
@@ -1003,8 +1121,9 @@ class ChunkGraph {
|
|
1003
1121
|
disconnectChunkAndEntryModule(chunk, module) {
|
1004
1122
|
const cgm = this._getChunkGraphModule(module);
|
1005
1123
|
const cgc = this._getChunkGraphChunk(chunk);
|
1006
|
-
|
1007
|
-
|
1124
|
+
/** @type {EntryInChunks} */
|
1125
|
+
(cgm.entryInChunks).delete(chunk);
|
1126
|
+
if (/** @type {EntryInChunks} */ (cgm.entryInChunks).size === 0) {
|
1008
1127
|
cgm.entryInChunks = undefined;
|
1009
1128
|
}
|
1010
1129
|
cgc.entryModules.delete(module);
|
@@ -1018,8 +1137,9 @@ class ChunkGraph {
|
|
1018
1137
|
disconnectChunkAndRuntimeModule(chunk, module) {
|
1019
1138
|
const cgm = this._getChunkGraphModule(module);
|
1020
1139
|
const cgc = this._getChunkGraphChunk(chunk);
|
1021
|
-
|
1022
|
-
|
1140
|
+
/** @type {RuntimeInChunks} */
|
1141
|
+
(cgm.runtimeInChunks).delete(chunk);
|
1142
|
+
if (/** @type {RuntimeInChunks} */ (cgm.runtimeInChunks).size === 0) {
|
1023
1143
|
cgm.runtimeInChunks = undefined;
|
1024
1144
|
}
|
1025
1145
|
cgc.runtimeModules.delete(module);
|
@@ -1031,7 +1151,7 @@ class ChunkGraph {
|
|
1031
1151
|
*/
|
1032
1152
|
disconnectEntryModule(module) {
|
1033
1153
|
const cgm = this._getChunkGraphModule(module);
|
1034
|
-
for (const chunk of cgm.entryInChunks) {
|
1154
|
+
for (const chunk of /** @type {EntryInChunks} */ (cgm.entryInChunks)) {
|
1035
1155
|
const cgc = this._getChunkGraphChunk(chunk);
|
1036
1156
|
cgc.entryModules.delete(module);
|
1037
1157
|
}
|
@@ -1046,8 +1166,9 @@ class ChunkGraph {
|
|
1046
1166
|
const cgc = this._getChunkGraphChunk(chunk);
|
1047
1167
|
for (const module of cgc.entryModules.keys()) {
|
1048
1168
|
const cgm = this._getChunkGraphModule(module);
|
1049
|
-
|
1050
|
-
|
1169
|
+
/** @type {EntryInChunks} */
|
1170
|
+
(cgm.entryInChunks).delete(chunk);
|
1171
|
+
if (/** @type {EntryInChunks} */ (cgm.entryInChunks).size === 0) {
|
1051
1172
|
cgm.entryInChunks = undefined;
|
1052
1173
|
}
|
1053
1174
|
}
|
@@ -1139,14 +1260,7 @@ class ChunkGraph {
|
|
1139
1260
|
const array = Array.from(cgc.runtimeModules);
|
1140
1261
|
array.sort(
|
1141
1262
|
concatComparators(
|
1142
|
-
compareSelect(
|
1143
|
-
/**
|
1144
|
-
* @param {RuntimeModule} r runtime module
|
1145
|
-
* @returns {number=} stage
|
1146
|
-
*/
|
1147
|
-
r => r.stage,
|
1148
|
-
compareIds
|
1149
|
-
),
|
1263
|
+
compareSelect(r => /** @type {RuntimeModule} */ (r).stage, compareIds),
|
1150
1264
|
compareModulesByIdentifier
|
1151
1265
|
)
|
1152
1266
|
);
|
@@ -1180,8 +1294,6 @@ class ChunkGraph {
|
|
1180
1294
|
return cgc.dependentHashModules;
|
1181
1295
|
}
|
1182
1296
|
|
1183
|
-
/** @typedef {[Module, Entrypoint | undefined]} EntryModuleWithChunkGroup */
|
1184
|
-
|
1185
1297
|
/**
|
1186
1298
|
* @param {Chunk} chunk the chunk
|
1187
1299
|
* @returns {Iterable<EntryModuleWithChunkGroup>} iterable of modules (do not modify)
|
@@ -1193,7 +1305,7 @@ class ChunkGraph {
|
|
1193
1305
|
|
1194
1306
|
/**
|
1195
1307
|
* @param {AsyncDependenciesBlock} depBlock the async block
|
1196
|
-
* @returns {ChunkGroup} the chunk group
|
1308
|
+
* @returns {ChunkGroup | undefined} the chunk group
|
1197
1309
|
*/
|
1198
1310
|
getBlockChunkGroup(depBlock) {
|
1199
1311
|
return this._blockChunkGroups.get(depBlock);
|
@@ -1223,7 +1335,7 @@ class ChunkGraph {
|
|
1223
1335
|
|
1224
1336
|
/**
|
1225
1337
|
* @param {Module} module the module
|
1226
|
-
* @returns {
|
1338
|
+
* @returns {ModuleId | null} the id of the module
|
1227
1339
|
*/
|
1228
1340
|
getModuleId(module) {
|
1229
1341
|
const cgm = this._getChunkGraphModule(module);
|
@@ -1232,7 +1344,7 @@ class ChunkGraph {
|
|
1232
1344
|
|
1233
1345
|
/**
|
1234
1346
|
* @param {Module} module the module
|
1235
|
-
* @param {
|
1347
|
+
* @param {ModuleId} id the id of the module
|
1236
1348
|
* @returns {void}
|
1237
1349
|
*/
|
1238
1350
|
setModuleId(module, id) {
|
@@ -1245,7 +1357,7 @@ class ChunkGraph {
|
|
1245
1357
|
* @returns {string | number} the id of the runtime
|
1246
1358
|
*/
|
1247
1359
|
getRuntimeId(runtime) {
|
1248
|
-
return this._runtimeIds.get(runtime);
|
1360
|
+
return /** @type {string | number} */ (this._runtimeIds.get(runtime));
|
1249
1361
|
}
|
1250
1362
|
|
1251
1363
|
/**
|
@@ -1282,7 +1394,7 @@ class ChunkGraph {
|
|
1282
1394
|
Caller might not support runtime-dependent code generation (opt-out via optimization.usedExports: "global").`
|
1283
1395
|
);
|
1284
1396
|
}
|
1285
|
-
return first(hashInfoItems);
|
1397
|
+
return /** @type {T} */ (first(hashInfoItems));
|
1286
1398
|
} else {
|
1287
1399
|
const hashInfo = hashes.get(runtime);
|
1288
1400
|
if (!hashInfo) {
|
@@ -1306,7 +1418,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1306
1418
|
*/
|
1307
1419
|
hasModuleHashes(module, runtime) {
|
1308
1420
|
const cgm = this._getChunkGraphModule(module);
|
1309
|
-
const hashes = cgm.hashes;
|
1421
|
+
const hashes = /** @type {RuntimeSpecMap<ModuleHashInfo>} */ (cgm.hashes);
|
1310
1422
|
return hashes && hashes.has(runtime);
|
1311
1423
|
}
|
1312
1424
|
|
@@ -1317,7 +1429,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1317
1429
|
*/
|
1318
1430
|
getModuleHash(module, runtime) {
|
1319
1431
|
const cgm = this._getChunkGraphModule(module);
|
1320
|
-
const hashes = cgm.hashes;
|
1432
|
+
const hashes = /** @type {RuntimeSpecMap<ModuleHashInfo>} */ (cgm.hashes);
|
1321
1433
|
return this._getModuleHashInfo(module, hashes, runtime).hash;
|
1322
1434
|
}
|
1323
1435
|
|
@@ -1328,7 +1440,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1328
1440
|
*/
|
1329
1441
|
getRenderedModuleHash(module, runtime) {
|
1330
1442
|
const cgm = this._getChunkGraphModule(module);
|
1331
|
-
const hashes = cgm.hashes;
|
1443
|
+
const hashes = /** @type {RuntimeSpecMap<ModuleHashInfo>} */ (cgm.hashes);
|
1332
1444
|
return this._getModuleHashInfo(module, hashes, runtime).renderedHash;
|
1333
1445
|
}
|
1334
1446
|
|
@@ -1375,10 +1487,10 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1375
1487
|
} else if (!transferOwnership || runtimeRequirements.size >= items.size) {
|
1376
1488
|
for (const item of items) runtimeRequirements.add(item);
|
1377
1489
|
return runtimeRequirements;
|
1378
|
-
} else {
|
1379
|
-
for (const item of runtimeRequirements) items.add(item);
|
1380
|
-
return items;
|
1381
1490
|
}
|
1491
|
+
|
1492
|
+
for (const item of runtimeRequirements) items.add(item);
|
1493
|
+
return items;
|
1382
1494
|
});
|
1383
1495
|
}
|
1384
1496
|
|
@@ -1457,7 +1569,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1457
1569
|
return withConnections
|
1458
1570
|
? BigInt(
|
1459
1571
|
`0x${this._getModuleGraphHashWithConnections(cgm, module, runtime)}`
|
1460
|
-
|
1572
|
+
)
|
1461
1573
|
: this._getModuleGraphHashBigInt(cgm, module, runtime);
|
1462
1574
|
}
|
1463
1575
|
|
@@ -1474,6 +1586,10 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1474
1586
|
const graphHash = cgm.graphHashes.provide(runtime, () => {
|
1475
1587
|
const hash = createHash(this._hashFunction);
|
1476
1588
|
hash.update(`${cgm.id}${this.moduleGraph.isAsync(module)}`);
|
1589
|
+
const sourceTypes = this._getOverwrittenModuleSourceTypes(module);
|
1590
|
+
if (sourceTypes !== undefined) {
|
1591
|
+
for (const type of sourceTypes) hash.update(type);
|
1592
|
+
}
|
1477
1593
|
this.moduleGraph.getExportsInfo(module).updateHash(hash, runtime);
|
1478
1594
|
return BigInt(`0x${/** @type {string} */ (hash.digest("hex"))}`);
|
1479
1595
|
});
|
@@ -1490,6 +1606,11 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1490
1606
|
if (cgm.graphHashesWithConnections === undefined) {
|
1491
1607
|
cgm.graphHashesWithConnections = new RuntimeSpecMap();
|
1492
1608
|
}
|
1609
|
+
|
1610
|
+
/**
|
1611
|
+
* @param {ConnectionState} state state
|
1612
|
+
* @returns {"F" | "T" | "O"} result
|
1613
|
+
*/
|
1493
1614
|
const activeStateToString = state => {
|
1494
1615
|
if (state === false) return "F";
|
1495
1616
|
if (state === true) return "T";
|
@@ -1508,6 +1629,10 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1508
1629
|
const activeNamespaceModules = new Set();
|
1509
1630
|
/** @type {Map<string, Module | Set<Module>>} */
|
1510
1631
|
const connectedModules = new Map();
|
1632
|
+
/**
|
1633
|
+
* @param {ModuleGraphConnection} connection connection
|
1634
|
+
* @param {string} stateInfo state info
|
1635
|
+
*/
|
1511
1636
|
const processConnection = (connection, stateInfo) => {
|
1512
1637
|
const module = connection.module;
|
1513
1638
|
stateInfo += module.getExportsType(this.moduleGraph, strict);
|
@@ -1560,6 +1685,9 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1560
1685
|
? Array.from(connectedModules).sort(([a], [b]) => (a < b ? -1 : 1))
|
1561
1686
|
: connectedModules;
|
1562
1687
|
const hash = createHash(this._hashFunction);
|
1688
|
+
/**
|
1689
|
+
* @param {Module} module module
|
1690
|
+
*/
|
1563
1691
|
const addModuleToHash = module => {
|
1564
1692
|
hash.update(
|
1565
1693
|
this._getModuleGraphHashBigInt(
|
@@ -1569,6 +1697,9 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1569
1697
|
).toString(16)
|
1570
1698
|
);
|
1571
1699
|
};
|
1700
|
+
/**
|
1701
|
+
* @param {Set<Module>} modules modules
|
1702
|
+
*/
|
1572
1703
|
const addModulesToHash = modules => {
|
1573
1704
|
let xor = ZERO_BIG_INT;
|
1574
1705
|
for (const m of modules) {
|
@@ -1583,7 +1714,9 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1583
1714
|
hash.update(xor.toString(16));
|
1584
1715
|
};
|
1585
1716
|
if (activeNamespaceModules.size === 1)
|
1586
|
-
addModuleToHash(
|
1717
|
+
addModuleToHash(
|
1718
|
+
/** @type {Module} */ (activeNamespaceModules.values().next().value)
|
1719
|
+
);
|
1587
1720
|
else if (activeNamespaceModules.size > 1)
|
1588
1721
|
addModulesToHash(activeNamespaceModules);
|
1589
1722
|
for (const [stateInfo, modules] of connectedModulesInOrder) {
|
@@ -1627,12 +1760,13 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1627
1760
|
const chunkGraph = chunkGraphForModuleMap.get(module);
|
1628
1761
|
if (!chunkGraph)
|
1629
1762
|
throw new Error(
|
1630
|
-
|
1631
|
-
|
1763
|
+
`${
|
1764
|
+
deprecateMessage
|
1765
|
+
}: There was no ChunkGraph assigned to the Module for backward-compat (Use the new API)`
|
1632
1766
|
);
|
1633
1767
|
return chunkGraph;
|
1634
1768
|
},
|
1635
|
-
deprecateMessage
|
1769
|
+
`${deprecateMessage}: Use new ChunkGraph API`,
|
1636
1770
|
deprecationCode
|
1637
1771
|
);
|
1638
1772
|
deprecateGetChunkGraphForModuleMap.set(deprecateMessage, newFn);
|
@@ -1677,12 +1811,13 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
1677
1811
|
const chunkGraph = chunkGraphForChunkMap.get(chunk);
|
1678
1812
|
if (!chunkGraph)
|
1679
1813
|
throw new Error(
|
1680
|
-
|
1681
|
-
|
1814
|
+
`${
|
1815
|
+
deprecateMessage
|
1816
|
+
}There was no ChunkGraph assigned to the Chunk for backward-compat (Use the new API)`
|
1682
1817
|
);
|
1683
1818
|
return chunkGraph;
|
1684
1819
|
},
|
1685
|
-
deprecateMessage
|
1820
|
+
`${deprecateMessage}: Use new ChunkGraph API`,
|
1686
1821
|
deprecationCode
|
1687
1822
|
);
|
1688
1823
|
deprecateGetChunkGraphForChunkMap.set(deprecateMessage, newFn);
|