xhs-mp-pack 1.1.0-beta.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 +1 -0
- package/dist/Compilation.d.ts +239 -0
- package/dist/Compilation.js +3513 -0
- package/dist/Compiler.d.ts +76 -0
- package/dist/Compiler.js +845 -0
- package/dist/ConcatenationScope.d.ts +37 -0
- package/dist/ConcatenationScope.js +69 -0
- package/dist/FileSystemInfo.d.ts +183 -0
- package/dist/FileSystemInfo.js +2896 -0
- package/dist/MPPack.d.ts +33 -0
- package/dist/MPPack.js +163 -0
- package/dist/MPPackSetting.d.ts +52 -0
- package/dist/MPPackSetting.js +85 -0
- package/dist/MultiCompiler.d.ts +25 -0
- package/dist/MultiCompiler.js +387 -0
- package/dist/MultiWatching.d.ts +11 -0
- package/dist/MultiWatching.js +54 -0
- package/dist/PluginManager.d.ts +9 -0
- package/dist/PluginManager.js +359 -0
- package/dist/ResolverFactory.d.ts +7 -0
- package/dist/ResolverFactory.js +84 -0
- package/dist/Watching.d.ts +41 -0
- package/dist/Watching.js +359 -0
- package/dist/base/ArrayHelpers.d.ts +6 -0
- package/dist/base/ArrayHelpers.js +21 -0
- package/dist/base/ArrayQueue.d.ts +29 -0
- package/dist/base/ArrayQueue.js +87 -0
- package/dist/base/AsyncQueue.d.ts +37 -0
- package/dist/base/AsyncQueue.js +263 -0
- package/dist/base/ChunkHelpers.d.ts +3 -0
- package/dist/base/ChunkHelpers.js +26 -0
- package/dist/base/ConditionalInitFragment.d.ts +9 -0
- package/dist/base/ConditionalInitFragment.js +64 -0
- package/dist/base/GraphHelpers.d.ts +6 -0
- package/dist/base/GraphHelpers.js +32 -0
- package/dist/base/Hash.d.ts +6 -0
- package/dist/base/Hash.js +13 -0
- package/dist/base/InitFragment.d.ts +22 -0
- package/dist/base/InitFragment.js +113 -0
- package/dist/base/IterableHelpers.d.ts +4 -0
- package/dist/base/IterableHelpers.js +26 -0
- package/dist/base/LazyBucketSortedSet.d.ts +34 -0
- package/dist/base/LazyBucketSortedSet.js +188 -0
- package/dist/base/LazySet.d.ts +35 -0
- package/dist/base/LazySet.js +155 -0
- package/dist/base/MapHelpers.d.ts +14 -0
- package/dist/base/MapHelpers.js +27 -0
- package/dist/base/ModuleFilenameHelpers.d.ts +95 -0
- package/dist/base/ModuleFilenameHelpers.js +314 -0
- package/dist/base/NodeWatchFileSystem.d.ts +23 -0
- package/dist/base/NodeWatchFileSystem.js +135 -0
- package/dist/base/ParallelismFactorCalculator.d.ts +8 -0
- package/dist/base/ParallelismFactorCalculator.js +52 -0
- package/dist/base/Queue.d.ts +12 -0
- package/dist/base/Queue.js +25 -0
- package/dist/base/RequestShortener.d.ts +6 -0
- package/dist/base/RequestShortener.js +15 -0
- package/dist/base/Semaphore.d.ts +12 -0
- package/dist/base/Semaphore.js +37 -0
- package/dist/base/SetHelpers.d.ts +36 -0
- package/dist/base/SetHelpers.js +94 -0
- package/dist/base/SizeFormatHelpers.d.ts +2 -0
- package/dist/base/SizeFormatHelpers.js +15 -0
- package/dist/base/SizeOnlySource.d.ts +14 -0
- package/dist/base/SizeOnlySource.js +34 -0
- package/dist/base/SortableSet.d.ts +18 -0
- package/dist/base/SortableSet.js +90 -0
- package/dist/base/StackedCacheMap.d.ts +20 -0
- package/dist/base/StackedCacheMap.js +73 -0
- package/dist/base/StackedMap.d.ts +17 -0
- package/dist/base/StackedMap.js +103 -0
- package/dist/base/StartupHelpers.d.ts +4 -0
- package/dist/base/StartupHelpers.js +94 -0
- package/dist/base/StringXor.d.ts +53 -0
- package/dist/base/StringXor.js +94 -0
- package/dist/base/TupleQueue.d.ts +10 -0
- package/dist/base/TupleQueue.js +33 -0
- package/dist/base/TupleSet.d.ts +18 -0
- package/dist/base/TupleSet.js +115 -0
- package/dist/base/URLAbsoluteSpecifier.d.ts +3 -0
- package/dist/base/URLAbsoluteSpecifier.js +57 -0
- package/dist/base/WeakTupleMap.d.ts +20 -0
- package/dist/base/WeakTupleMap.js +124 -0
- package/dist/base/binarySearchBounds.d.ts +23 -0
- package/dist/base/binarySearchBounds.js +105 -0
- package/dist/base/cleverMerge.d.ts +27 -0
- package/dist/base/cleverMerge.js +450 -0
- package/dist/base/common.d.ts +7 -0
- package/dist/base/common.js +25 -0
- package/dist/base/commonjs.d.ts +1 -0
- package/dist/base/commonjs.js +48 -0
- package/dist/base/comparators.d.ts +22 -0
- package/dist/base/comparators.js +279 -0
- package/dist/base/compileBooleanMatcher.d.ts +6 -0
- package/dist/base/compileBooleanMatcher.js +162 -0
- package/dist/base/const.d.ts +29 -0
- package/dist/base/const.js +49 -0
- package/dist/base/copyPatterns.d.ts +14 -0
- package/dist/base/copyPatterns.js +501 -0
- package/dist/base/createHash.d.ts +3 -0
- package/dist/base/createHash.js +131 -0
- package/dist/base/defaults.d.ts +3 -0
- package/dist/base/defaults.js +671 -0
- package/dist/base/deprecation.d.ts +21 -0
- package/dist/base/deprecation.js +165 -0
- package/dist/base/deterministicGrouping.d.ts +8 -0
- package/dist/base/deterministicGrouping.js +395 -0
- package/dist/base/errors/AbstractMethodError.d.ts +5 -0
- package/dist/base/errors/AbstractMethodError.js +23 -0
- package/dist/base/errors/AsyncDependencyToInitialChunkError.d.ts +8 -0
- package/dist/base/errors/AsyncDependencyToInitialChunkError.js +18 -0
- package/dist/base/errors/BaseError.d.ts +17 -0
- package/dist/base/errors/BaseError.js +39 -0
- package/dist/base/errors/BuildCycleError.d.ts +8 -0
- package/dist/base/errors/BuildCycleError.js +17 -0
- package/dist/base/errors/CaseSensitiveModulesWarning.d.ts +5 -0
- package/dist/base/errors/CaseSensitiveModulesWarning.js +42 -0
- package/dist/base/errors/ChunkRenderError.d.ts +6 -0
- package/dist/base/errors/ChunkRenderError.js +18 -0
- package/dist/base/errors/CodeGenerationError.d.ts +8 -0
- package/dist/base/errors/CodeGenerationError.js +20 -0
- package/dist/base/errors/CommentCompilationWarning.d.ts +5 -0
- package/dist/base/errors/CommentCompilationWarning.js +16 -0
- package/dist/base/errors/ConcurrentCompilationError.d.ts +4 -0
- package/dist/base/errors/ConcurrentCompilationError.js +15 -0
- package/dist/base/errors/CriticalDependencyWarning.d.ts +5 -0
- package/dist/base/errors/CriticalDependencyWarning.js +16 -0
- package/dist/base/errors/ErrorHelpers.d.ts +8 -0
- package/dist/base/errors/ErrorHelpers.js +51 -0
- package/dist/base/errors/HarmonyLinkingError.d.ts +4 -0
- package/dist/base/errors/HarmonyLinkingError.js +14 -0
- package/dist/base/errors/HookBaseError.d.ts +10 -0
- package/dist/base/errors/HookBaseError.js +51 -0
- package/dist/base/errors/InvalidDependenciesModuleWarning.d.ts +5 -0
- package/dist/base/errors/InvalidDependenciesModuleWarning.js +26 -0
- package/dist/base/errors/MinMaxSizeWarning.d.ts +5 -0
- package/dist/base/errors/MinMaxSizeWarning.js +45 -0
- package/dist/base/errors/ModuleBuildError.d.ts +9 -0
- package/dist/base/errors/ModuleBuildError.js +62 -0
- package/dist/base/errors/ModuleDependencyError.d.ts +8 -0
- package/dist/base/errors/ModuleDependencyError.js +24 -0
- package/dist/base/errors/ModuleDependencyWarning.d.ts +6 -0
- package/dist/base/errors/ModuleDependencyWarning.js +23 -0
- package/dist/base/errors/ModuleError.d.ts +10 -0
- package/dist/base/errors/ModuleError.js +42 -0
- package/dist/base/errors/ModuleHashingError.d.ts +5 -0
- package/dist/base/errors/ModuleHashingError.js +17 -0
- package/dist/base/errors/ModuleNotFoundError.d.ts +5 -0
- package/dist/base/errors/ModuleNotFoundError.js +69 -0
- package/dist/base/errors/ModuleParseError.d.ts +8 -0
- package/dist/base/errors/ModuleParseError.js +77 -0
- package/dist/base/errors/ModuleRestoreError.d.ts +5 -0
- package/dist/base/errors/ModuleRestoreError.js +33 -0
- package/dist/base/errors/ModuleStoreError.d.ts +5 -0
- package/dist/base/errors/ModuleStoreError.js +33 -0
- package/dist/base/errors/ModuleWarning.d.ts +10 -0
- package/dist/base/errors/ModuleWarning.js +44 -0
- package/dist/base/errors/NodeStuffInWebError.d.ts +5 -0
- package/dist/base/errors/NodeStuffInWebError.js +17 -0
- package/dist/base/errors/UnhandledSchemeError.d.ts +5 -0
- package/dist/base/errors/UnhandledSchemeError.js +18 -0
- package/dist/base/errors/UnsupportedFeatureWarning.d.ts +5 -0
- package/dist/base/errors/UnsupportedFeatureWarning.js +17 -0
- package/dist/base/extractUrlAndGlobal.d.ts +1 -0
- package/dist/base/extractUrlAndGlobal.js +10 -0
- package/dist/base/findGraphRoots.d.ts +2 -0
- package/dist/base/findGraphRoots.js +183 -0
- package/dist/base/formatLocation.d.ts +2 -0
- package/dist/base/formatLocation.js +47 -0
- package/dist/base/fs.d.ts +94 -0
- package/dist/base/fs.js +218 -0
- package/dist/base/hash/BatchedHash.d.ts +11 -0
- package/dist/base/hash/BatchedHash.js +47 -0
- package/dist/base/hash/md4.d.ts +2 -0
- package/dist/base/hash/md4.js +10 -0
- package/dist/base/hash/wasm-hash.d.ts +3 -0
- package/dist/base/hash/wasm-hash.js +138 -0
- package/dist/base/hash/xxhash64.d.ts +2 -0
- package/dist/base/hash/xxhash64.js +10 -0
- package/dist/base/identifier.d.ts +30 -0
- package/dist/base/identifier.js +237 -0
- package/dist/base/logging/Logger.d.ts +40 -0
- package/dist/base/logging/Logger.js +128 -0
- package/dist/base/logging/createConsoleLogger.d.ts +6 -0
- package/dist/base/logging/createConsoleLogger.js +161 -0
- package/dist/base/logging/nodeConsole.d.ts +21 -0
- package/dist/base/logging/nodeConsole.js +109 -0
- package/dist/base/logging/runtime.d.ts +8 -0
- package/dist/base/logging/runtime.js +30 -0
- package/dist/base/logging/truncateArgs.d.ts +2 -0
- package/dist/base/logging/truncateArgs.js +66 -0
- package/dist/base/memoize.d.ts +2 -0
- package/dist/base/memoize.js +18 -0
- package/dist/base/missingModule.d.ts +4 -0
- package/dist/base/missingModule.js +16 -0
- package/dist/base/moduleAlias.d.ts +1 -0
- package/dist/base/moduleAlias.js +8 -0
- package/dist/base/nonNumericOnlyHash.d.ts +7 -0
- package/dist/base/nonNumericOnlyHash.js +16 -0
- package/dist/base/normalization.d.ts +32 -0
- package/dist/base/normalization.js +320 -0
- package/dist/base/numberHash.d.ts +17 -0
- package/dist/base/numberHash.js +72 -0
- package/dist/base/objectToMap.d.ts +1 -0
- package/dist/base/objectToMap.js +6 -0
- package/dist/base/processAsyncTree.d.ts +2 -0
- package/dist/base/processAsyncTree.js +45 -0
- package/dist/base/propertyAccess.d.ts +2 -0
- package/dist/base/propertyAccess.js +20 -0
- package/dist/base/propertyName.d.ts +9 -0
- package/dist/base/propertyName.js +71 -0
- package/dist/base/semver.d.ts +25 -0
- package/dist/base/semver.js +425 -0
- package/dist/base/singletontask.d.ts +27 -0
- package/dist/base/singletontask.js +124 -0
- package/dist/base/smartGrouping.d.ts +2 -0
- package/dist/base/smartGrouping.js +138 -0
- package/dist/base/source.d.ts +2 -0
- package/dist/base/source.js +48 -0
- package/dist/base/stats/MultiStats.d.ts +19 -0
- package/dist/base/stats/MultiStats.js +142 -0
- package/dist/base/stats/Stats.d.ts +13 -0
- package/dist/base/stats/Stats.js +49 -0
- package/dist/base/stats/StatsFactory.d.ts +26 -0
- package/dist/base/stats/StatsFactory.js +163 -0
- package/dist/base/stats/StatsPrinter.d.ts +12 -0
- package/dist/base/stats/StatsPrinter.js +104 -0
- package/dist/base/utils.d.ts +5 -0
- package/dist/base/utils.js +35 -0
- package/dist/cache/AddBuildDependenciesPlugin.d.ts +6 -0
- package/dist/cache/AddBuildDependenciesPlugin.js +13 -0
- package/dist/cache/AddManagedPathsPlugin.d.ts +7 -0
- package/dist/cache/AddManagedPathsPlugin.js +17 -0
- package/dist/cache/Cache.d.ts +15 -0
- package/dist/cache/Cache.js +69 -0
- package/dist/cache/CacheFacade.d.ts +37 -0
- package/dist/cache/CacheFacade.js +187 -0
- package/dist/cache/IdleFileCachePlugin.d.ts +9 -0
- package/dist/cache/IdleFileCachePlugin.js +165 -0
- package/dist/cache/MemoryCachePlugin.d.ts +4 -0
- package/dist/cache/MemoryCachePlugin.js +36 -0
- package/dist/cache/MemoryWithGcCachePlugin.d.ts +8 -0
- package/dist/cache/MemoryWithGcCachePlugin.js +104 -0
- package/dist/cache/PackFileCacheStrategy.d.ts +47 -0
- package/dist/cache/PackFileCacheStrategy.js +1085 -0
- package/dist/cache/ResolverCachePlugin.d.ts +4 -0
- package/dist/cache/ResolverCachePlugin.js +248 -0
- package/dist/cache/getLazyHashedEtag.d.ts +2 -0
- package/dist/cache/getLazyHashedEtag.js +53 -0
- package/dist/cache/mergeEtags.d.ts +2 -0
- package/dist/cache/mergeEtags.js +50 -0
- package/dist/chunk/Chunk.d.ts +75 -0
- package/dist/chunk/Chunk.js +445 -0
- package/dist/chunk/ChunkGraph.d.ts +102 -0
- package/dist/chunk/ChunkGraph.js +1037 -0
- package/dist/chunk/ChunkGroup.d.ts +62 -0
- package/dist/chunk/ChunkGroup.js +341 -0
- package/dist/chunk/CodeGenerationResults.d.ts +13 -0
- package/dist/chunk/CodeGenerationResults.js +82 -0
- package/dist/chunk/Entrypoint.d.ts +22 -0
- package/dist/chunk/Entrypoint.js +56 -0
- package/dist/chunk/GraphHelpers.d.ts +3 -0
- package/dist/chunk/GraphHelpers.js +15 -0
- package/dist/chunk/buildChunkGraph.d.ts +2 -0
- package/dist/chunk/buildChunkGraph.js +1067 -0
- package/dist/chunk/chunkFormat/ArrayPushCallbackChunkFormatPlugin.d.ts +4 -0
- package/dist/chunk/chunkFormat/ArrayPushCallbackChunkFormatPlugin.js +101 -0
- package/dist/chunk/chunkLoading/JsonpChunkLoadingPlugin.d.ts +4 -0
- package/dist/chunk/chunkLoading/JsonpChunkLoadingPlugin.js +98 -0
- package/dist/chunk/chunkLoading/JsonpChunkLoadingRuntimeModule.d.ts +15 -0
- package/dist/chunk/chunkLoading/JsonpChunkLoadingRuntimeModule.js +272 -0
- package/dist/dependencies/AsyncDependenciesBlock.d.ts +14 -0
- package/dist/dependencies/AsyncDependenciesBlock.js +64 -0
- package/dist/dependencies/CreateScriptUrlDependency.d.ts +9 -0
- package/dist/dependencies/CreateScriptUrlDependency.js +60 -0
- package/dist/dependencies/DelegatedSourceDependency.d.ts +7 -0
- package/dist/dependencies/DelegatedSourceDependency.js +20 -0
- package/dist/dependencies/DependenciesBlock.d.ts +29 -0
- package/dist/dependencies/DependenciesBlock.js +66 -0
- package/dist/dependencies/Dependency.d.ts +44 -0
- package/dist/dependencies/Dependency.js +171 -0
- package/dist/dependencies/DependencyTemplate.d.ts +4 -0
- package/dist/dependencies/DependencyTemplate.js +9 -0
- package/dist/dependencies/DependencyTemplates.d.ts +12 -0
- package/dist/dependencies/DependencyTemplates.js +34 -0
- package/dist/dependencies/DynamicExports.d.ts +6 -0
- package/dist/dependencies/DynamicExports.js +48 -0
- package/dist/dependencies/ExportsInfoDependency.d.ts +10 -0
- package/dist/dependencies/ExportsInfoDependency.js +80 -0
- package/dist/dependencies/LocalModule.d.ts +11 -0
- package/dist/dependencies/LocalModule.js +33 -0
- package/dist/dependencies/LocalModuleDependency.d.ts +10 -0
- package/dist/dependencies/LocalModuleDependency.js +42 -0
- package/dist/dependencies/LocalModulesHelpers.d.ts +4 -0
- package/dist/dependencies/LocalModulesHelpers.js +48 -0
- package/dist/dependencies/ModuleDecoratorDependency.d.ts +15 -0
- package/dist/dependencies/ModuleDecoratorDependency.js +85 -0
- package/dist/dependencies/ModuleDependency.d.ts +16 -0
- package/dist/dependencies/ModuleDependency.js +53 -0
- package/dist/dependencies/ModuleDependencyTemplateAsId.d.ts +9 -0
- package/dist/dependencies/ModuleDependencyTemplateAsId.js +21 -0
- package/dist/dependencies/ModuleDependencyTemplateAsRequireId.d.ts +10 -0
- package/dist/dependencies/ModuleDependencyTemplateAsRequireId.js +22 -0
- package/dist/dependencies/NullDependency.d.ts +7 -0
- package/dist/dependencies/NullDependency.js +19 -0
- package/dist/dependencies/PureExpressionDependency.d.ts +12 -0
- package/dist/dependencies/PureExpressionDependency.js +73 -0
- package/dist/dependencies/RequireHeaderDependency.d.ts +8 -0
- package/dist/dependencies/RequireHeaderDependency.js +58 -0
- package/dist/dependencies/RequireResolveContextDependency.d.ts +8 -0
- package/dist/dependencies/RequireResolveContextDependency.js +33 -0
- package/dist/dependencies/RequireResolveDependency.d.ts +10 -0
- package/dist/dependencies/RequireResolveDependency.js +29 -0
- package/dist/dependencies/RequireResolveHeaderDependency.d.ts +8 -0
- package/dist/dependencies/RequireResolveHeaderDependency.js +36 -0
- package/dist/dependencies/RuntimeRequirementsDependency.d.ts +10 -0
- package/dist/dependencies/RuntimeRequirementsDependency.js +40 -0
- package/dist/dependencies/StaticExportsDependency.d.ts +15 -0
- package/dist/dependencies/StaticExportsDependency.js +38 -0
- package/dist/dependencies/URLDependency.d.ts +16 -0
- package/dist/dependencies/URLDependency.js +103 -0
- package/dist/dependencies/URLPlugin.d.ts +4 -0
- package/dist/dependencies/URLPlugin.js +107 -0
- package/dist/dependencies/UnsupportedDependency.d.ts +9 -0
- package/dist/dependencies/UnsupportedDependency.js +36 -0
- package/dist/dependencies/commonjs/CommonJsDependencyHelpers.d.ts +2 -0
- package/dist/dependencies/commonjs/CommonJsDependencyHelpers.js +67 -0
- package/dist/dependencies/commonjs/CommonJsExportRequireDependency.d.ts +46 -0
- package/dist/dependencies/commonjs/CommonJsExportRequireDependency.js +260 -0
- package/dist/dependencies/commonjs/CommonJsExportsDependency.d.ts +19 -0
- package/dist/dependencies/commonjs/CommonJsExportsDependency.js +82 -0
- package/dist/dependencies/commonjs/CommonJsExportsParserPlugin.d.ts +6 -0
- package/dist/dependencies/commonjs/CommonJsExportsParserPlugin.js +314 -0
- package/dist/dependencies/commonjs/CommonJsFullRequireDependency.d.ts +13 -0
- package/dist/dependencies/commonjs/CommonJsFullRequireDependency.js +77 -0
- package/dist/dependencies/commonjs/CommonJsImportsParserPlugin.d.ts +6 -0
- package/dist/dependencies/commonjs/CommonJsImportsParserPlugin.js +500 -0
- package/dist/dependencies/commonjs/CommonJsPlugin.d.ts +4 -0
- package/dist/dependencies/commonjs/CommonJsPlugin.js +170 -0
- package/dist/dependencies/commonjs/CommonJsRequireContextDependency.d.ts +8 -0
- package/dist/dependencies/commonjs/CommonJsRequireContextDependency.js +37 -0
- package/dist/dependencies/commonjs/CommonJsRequireDependency.d.ts +7 -0
- package/dist/dependencies/commonjs/CommonJsRequireDependency.js +24 -0
- package/dist/dependencies/commonjs/CommonJsSelfReferenceDependency.d.ts +15 -0
- package/dist/dependencies/commonjs/CommonJsSelfReferenceDependency.js +112 -0
- package/dist/dependencies/const/CachedConstDependency.d.ts +12 -0
- package/dist/dependencies/const/CachedConstDependency.js +50 -0
- package/dist/dependencies/const/ConstDependency.d.ts +13 -0
- package/dist/dependencies/const/ConstDependency.js +63 -0
- package/dist/dependencies/context/ContextDependency.d.ts +26 -0
- package/dist/dependencies/context/ContextDependency.js +91 -0
- package/dist/dependencies/context/ContextDependencyHelpers.d.ts +2 -0
- package/dist/dependencies/context/ContextDependencyHelpers.js +128 -0
- package/dist/dependencies/context/ContextDependencyTemplateAsId.d.ts +10 -0
- package/dist/dependencies/context/ContextDependencyTemplateAsId.js +37 -0
- package/dist/dependencies/context/ContextDependencyTemplateAsRequireCall.d.ts +10 -0
- package/dist/dependencies/context/ContextDependencyTemplateAsRequireCall.js +39 -0
- package/dist/dependencies/context/ContextElementDependency.d.ts +13 -0
- package/dist/dependencies/context/ContextElementDependency.js +53 -0
- package/dist/dependencies/css/CssExportDependency.d.ts +17 -0
- package/dist/dependencies/css/CssExportDependency.js +49 -0
- package/dist/dependencies/css/CssImportDependency.d.ts +14 -0
- package/dist/dependencies/css/CssImportDependency.js +60 -0
- package/dist/dependencies/css/CssLocalIdentifierDependency.d.ts +12 -0
- package/dist/dependencies/css/CssLocalIdentifierDependency.js +69 -0
- package/dist/dependencies/css/CssSelfLocalIdentifierDependency.d.ts +13 -0
- package/dist/dependencies/css/CssSelfLocalIdentifierDependency.js +53 -0
- package/dist/dependencies/css/CssUrlDependency.d.ts +12 -0
- package/dist/dependencies/css/CssUrlDependency.js +89 -0
- package/dist/dependencies/entry/DynamicEntryPlugin.d.ts +22 -0
- package/dist/dependencies/entry/DynamicEntryPlugin.js +62 -0
- package/dist/dependencies/entry/EntryDependency.d.ts +7 -0
- package/dist/dependencies/entry/EntryDependency.js +20 -0
- package/dist/dependencies/getFunctionExpression.d.ts +10 -0
- package/dist/dependencies/getFunctionExpression.js +42 -0
- package/dist/dependencies/harmony/HarmonyAcceptDependency.d.ts +11 -0
- package/dist/dependencies/harmony/HarmonyAcceptDependency.js +81 -0
- package/dist/dependencies/harmony/HarmonyAcceptImportDependency.d.ts +6 -0
- package/dist/dependencies/harmony/HarmonyAcceptImportDependency.js +20 -0
- package/dist/dependencies/harmony/HarmonyCompatibilityDependency.d.ts +5 -0
- package/dist/dependencies/harmony/HarmonyCompatibilityDependency.js +61 -0
- package/dist/dependencies/harmony/HarmonyDetectionParserPlugin.d.ts +5 -0
- package/dist/dependencies/harmony/HarmonyDetectionParserPlugin.js +102 -0
- package/dist/dependencies/harmony/HarmonyEvaluatedImportSpecifierDependency.d.ts +16 -0
- package/dist/dependencies/harmony/HarmonyEvaluatedImportSpecifierDependency.js +84 -0
- package/dist/dependencies/harmony/HarmonyExportDependencyParserPlugin.d.ts +5 -0
- package/dist/dependencies/harmony/HarmonyExportDependencyParserPlugin.js +143 -0
- package/dist/dependencies/harmony/HarmonyExportExpressionDependency.d.ts +23 -0
- package/dist/dependencies/harmony/HarmonyExportExpressionDependency.js +148 -0
- package/dist/dependencies/harmony/HarmonyExportHeaderDependency.d.ts +10 -0
- package/dist/dependencies/harmony/HarmonyExportHeaderDependency.js +39 -0
- package/dist/dependencies/harmony/HarmonyExportImportedSpecifierDependency.d.ts +140 -0
- package/dist/dependencies/harmony/HarmonyExportImportedSpecifierDependency.js +763 -0
- package/dist/dependencies/harmony/HarmonyExportInitFragment.d.ts +14 -0
- package/dist/dependencies/harmony/HarmonyExportInitFragment.js +147 -0
- package/dist/dependencies/harmony/HarmonyExportSpecifierDependency.d.ts +17 -0
- package/dist/dependencies/harmony/HarmonyExportSpecifierDependency.js +62 -0
- package/dist/dependencies/harmony/HarmonyExports.d.ts +3 -0
- package/dist/dependencies/harmony/HarmonyExports.js +51 -0
- package/dist/dependencies/harmony/HarmonyImportDependency.d.ts +30 -0
- package/dist/dependencies/harmony/HarmonyImportDependency.js +217 -0
- package/dist/dependencies/harmony/HarmonyImportDependencyParserPlugin.d.ts +9 -0
- package/dist/dependencies/harmony/HarmonyImportDependencyParserPlugin.js +202 -0
- package/dist/dependencies/harmony/HarmonyImportSideEffectDependency.d.ts +8 -0
- package/dist/dependencies/harmony/HarmonyImportSideEffectDependency.js +43 -0
- package/dist/dependencies/harmony/HarmonyImportSpecifierDependency.d.ts +33 -0
- package/dist/dependencies/harmony/HarmonyImportSpecifierDependency.js +272 -0
- package/dist/dependencies/harmony/HarmonyModulesPlugin.d.ts +6 -0
- package/dist/dependencies/harmony/HarmonyModulesPlugin.js +57 -0
- package/dist/dependencies/harmony/HarmonyTopLevelThisParserPlugin.d.ts +4 -0
- package/dist/dependencies/harmony/HarmonyTopLevelThisParserPlugin.js +45 -0
- package/dist/dependencies/import/ImportContextDependency.d.ts +9 -0
- package/dist/dependencies/import/ImportContextDependency.js +34 -0
- package/dist/dependencies/import/ImportDependency.d.ts +11 -0
- package/dist/dependencies/import/ImportDependency.js +57 -0
- package/dist/dependencies/import/ImportEagerDependency.d.ts +7 -0
- package/dist/dependencies/import/ImportEagerDependency.js +34 -0
- package/dist/dependencies/import/ImportMetaContextDependency.d.ts +7 -0
- package/dist/dependencies/import/ImportMetaContextDependency.js +23 -0
- package/dist/dependencies/import/ImportMetaContextDependencyParserPlugin.d.ts +3 -0
- package/dist/dependencies/import/ImportMetaContextDependencyParserPlugin.js +207 -0
- package/dist/dependencies/import/ImportMetaContextPlugin.d.ts +4 -0
- package/dist/dependencies/import/ImportMetaContextPlugin.js +27 -0
- package/dist/dependencies/import/ImportMetaHotAcceptDependency.d.ts +7 -0
- package/dist/dependencies/import/ImportMetaHotAcceptDependency.js +24 -0
- package/dist/dependencies/import/ImportMetaHotDeclineDependency.d.ts +7 -0
- package/dist/dependencies/import/ImportMetaHotDeclineDependency.js +24 -0
- package/dist/dependencies/import/ImportMetaPlugin.d.ts +4 -0
- package/dist/dependencies/import/ImportMetaPlugin.js +129 -0
- package/dist/dependencies/import/ImportParserPlugin.d.ts +6 -0
- package/dist/dependencies/import/ImportParserPlugin.js +207 -0
- package/dist/dependencies/import/ImportPlugin.d.ts +4 -0
- package/dist/dependencies/import/ImportPlugin.js +37 -0
- package/dist/dependencies/import/ImportWeakDependency.d.ts +6 -0
- package/dist/dependencies/import/ImportWeakDependency.js +33 -0
- package/dist/dependencies/json/JsonExportsDependency.d.ts +14 -0
- package/dist/dependencies/json/JsonExportsDependency.js +61 -0
- package/dist/dependencies/loader/LoaderDependency.d.ts +8 -0
- package/dist/dependencies/loader/LoaderDependency.js +21 -0
- package/dist/dependencies/loader/LoaderImportDependency.d.ts +8 -0
- package/dist/dependencies/loader/LoaderImportDependency.js +22 -0
- package/dist/dependencies/loader/LoaderPlugin.d.ts +5 -0
- package/dist/dependencies/loader/LoaderPlugin.js +164 -0
- package/dist/dependencies/processExportInfo.d.ts +2 -0
- package/dist/dependencies/processExportInfo.js +32 -0
- package/dist/ids/DeterministicChunkIdsPlugin.d.ts +10 -0
- package/dist/ids/DeterministicChunkIdsPlugin.js +30 -0
- package/dist/ids/DeterministicModuleIdsPlugin.d.ts +6 -0
- package/dist/ids/DeterministicModuleIdsPlugin.js +38 -0
- package/dist/ids/IdHelpers.d.ts +16 -0
- package/dist/ids/IdHelpers.js +259 -0
- package/dist/ids/NamedChunkIdsPlugin.d.ts +11 -0
- package/dist/ids/NamedChunkIdsPlugin.js +34 -0
- package/dist/ids/NamedModuleIdsPlugin.d.ts +6 -0
- package/dist/ids/NamedModuleIdsPlugin.js +25 -0
- package/dist/ids/NaturalChunkIdsPlugin.d.ts +4 -0
- package/dist/ids/NaturalChunkIdsPlugin.js +17 -0
- package/dist/ids/NaturalModuleIdsPlugin.d.ts +4 -0
- package/dist/ids/NaturalModuleIdsPlugin.js +16 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +58 -0
- package/dist/library/AbstractLibraryPlugin.d.ts +21 -0
- package/dist/library/AbstractLibraryPlugin.js +177 -0
- package/dist/library/AssignLibraryPlugin.d.ts +53 -0
- package/dist/library/AssignLibraryPlugin.js +201 -0
- package/dist/library/EnableLibraryPlugin.d.ts +8 -0
- package/dist/library/EnableLibraryPlugin.js +174 -0
- package/dist/library/ExportPropertyLibraryPlugin.d.ts +22 -0
- package/dist/library/ExportPropertyLibraryPlugin.js +74 -0
- package/dist/library/JsonpLibraryPlugin.d.ts +19 -0
- package/dist/library/JsonpLibraryPlugin.js +35 -0
- package/dist/library/ModuleLibraryPlugin.d.ts +16 -0
- package/dist/library/ModuleLibraryPlugin.js +73 -0
- package/dist/library/UmdLibraryPlugin.d.ts +22 -0
- package/dist/library/UmdLibraryPlugin.js +161 -0
- package/dist/module/ContextExclusionPlugin.d.ts +6 -0
- package/dist/module/ContextExclusionPlugin.js +13 -0
- package/dist/module/ContextModule.d.ts +75 -0
- package/dist/module/ContextModule.js +844 -0
- package/dist/module/ContextModuleFactory.d.ts +8 -0
- package/dist/module/ContextModuleFactory.js +292 -0
- package/dist/module/ContextReplacementPlugin.d.ts +11 -0
- package/dist/module/ContextReplacementPlugin.js +128 -0
- package/dist/module/CssModule.d.ts +20 -0
- package/dist/module/CssModule.js +105 -0
- package/dist/module/ExportsInfo.d.ts +135 -0
- package/dist/module/ExportsInfo.js +1171 -0
- package/dist/module/ExportsInfoApiPlugin.d.ts +4 -0
- package/dist/module/ExportsInfoApiPlugin.js +38 -0
- package/dist/module/ExternalModule.d.ts +47 -0
- package/dist/module/ExternalModule.js +458 -0
- package/dist/module/ExternalModuleFactoryPlugin.d.ts +7 -0
- package/dist/module/ExternalModuleFactoryPlugin.js +176 -0
- package/dist/module/ExternalsPlugin.d.ts +7 -0
- package/dist/module/ExternalsPlugin.js +18 -0
- package/dist/module/Generator.d.ts +40 -0
- package/dist/module/Generator.js +49 -0
- package/dist/module/IgnoreErrorModuleFactory.d.ts +7 -0
- package/dist/module/IgnoreErrorModuleFactory.js +16 -0
- package/dist/module/JavascriptMetaInfoPlugin.d.ts +4 -0
- package/dist/module/JavascriptMetaInfoPlugin.js +65 -0
- package/dist/module/LazyModuleFactoryPlugin.d.ts +6 -0
- package/dist/module/LazyModuleFactoryPlugin.js +171 -0
- package/dist/module/Module.d.ts +175 -0
- package/dist/module/Module.js +550 -0
- package/dist/module/ModuleFactory.d.ts +25 -0
- package/dist/module/ModuleFactory.js +10 -0
- package/dist/module/ModuleGraph.d.ts +74 -0
- package/dist/module/ModuleGraph.js +470 -0
- package/dist/module/ModuleGraphConnection.d.ts +33 -0
- package/dist/module/ModuleGraphConnection.js +113 -0
- package/dist/module/ModuleProfile.d.ts +40 -0
- package/dist/module/ModuleProfile.js +77 -0
- package/dist/module/ModuleTypeConstants.d.ts +22 -0
- package/dist/module/ModuleTypeConstants.js +45 -0
- package/dist/module/NormalModule.d.ts +104 -0
- package/dist/module/NormalModule.js +904 -0
- package/dist/module/NormalModuleFactory.d.ts +36 -0
- package/dist/module/NormalModuleFactory.js +761 -0
- package/dist/module/Parser.d.ts +4 -0
- package/dist/module/Parser.js +9 -0
- package/dist/module/RawModule.d.ts +29 -0
- package/dist/module/RawModule.js +74 -0
- package/dist/module/RuntimeGlobals.d.ts +310 -0
- package/dist/module/RuntimeGlobals.js +316 -0
- package/dist/module/RuntimeHelpers.d.ts +43 -0
- package/dist/module/RuntimeHelpers.js +548 -0
- package/dist/module/RuntimeModule.d.ts +39 -0
- package/dist/module/RuntimeModule.js +114 -0
- package/dist/module/RuntimePlugin.d.ts +4 -0
- package/dist/module/RuntimePlugin.js +332 -0
- package/dist/module/SelfModuleFactory.d.ts +6 -0
- package/dist/module/SelfModuleFactory.js +14 -0
- package/dist/module/asset/AssetGenerator.d.ts +30 -0
- package/dist/module/asset/AssetGenerator.js +364 -0
- package/dist/module/asset/AssetModulesPlugin.d.ts +4 -0
- package/dist/module/asset/AssetModulesPlugin.js +98 -0
- package/dist/module/asset/AssetParser.d.ts +12 -0
- package/dist/module/asset/AssetParser.js +44 -0
- package/dist/module/asset/AssetSourceGenerator.d.ts +14 -0
- package/dist/module/asset/AssetSourceGenerator.js +74 -0
- package/dist/module/asset/AssetSourceParser.d.ts +5 -0
- package/dist/module/asset/AssetSourceParser.js +19 -0
- package/dist/module/asset/RawDataUrlModule.d.ts +27 -0
- package/dist/module/asset/RawDataUrlModule.js +102 -0
- package/dist/module/async-modules/AwaitDependenciesInitFragment.d.ts +10 -0
- package/dist/module/async-modules/AwaitDependenciesInitFragment.js +68 -0
- package/dist/module/async-modules/InferAsyncModulesPlugin.d.ts +4 -0
- package/dist/module/async-modules/InferAsyncModulesPlugin.js +28 -0
- package/dist/module/javascript/BasicEvaluatedExpression.d.ts +139 -0
- package/dist/module/javascript/BasicEvaluatedExpression.js +481 -0
- package/dist/module/javascript/JavascriptGenerator.d.ts +11 -0
- package/dist/module/javascript/JavascriptGenerator.js +103 -0
- package/dist/module/javascript/JavascriptModulesPlugin.d.ts +17 -0
- package/dist/module/javascript/JavascriptModulesPlugin.js +821 -0
- package/dist/module/javascript/JavascriptParser.d.ts +598 -0
- package/dist/module/javascript/JavascriptParser.js +3579 -0
- package/dist/module/javascript/JavascriptParserHelpers.d.ts +10 -0
- package/dist/module/javascript/JavascriptParserHelpers.js +61 -0
- package/dist/module/json/JsonData.d.ts +9 -0
- package/dist/module/json/JsonData.js +43 -0
- package/dist/module/json/JsonGenerator.d.ts +15 -0
- package/dist/module/json/JsonGenerator.js +137 -0
- package/dist/module/json/JsonModulesPlugin.d.ts +4 -0
- package/dist/module/json/JsonModulesPlugin.js +20 -0
- package/dist/module/json/JsonParser.d.ts +7 -0
- package/dist/module/json/JsonParser.js +41 -0
- package/dist/module/runtime/AsyncModuleRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/AsyncModuleRuntimeModule.js +115 -0
- package/dist/module/runtime/AutoPublicPathRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/AutoPublicPathRuntimeModule.js +81 -0
- package/dist/module/runtime/BaseUriRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/BaseUriRuntimeModule.js +41 -0
- package/dist/module/runtime/ChunkNameRuntimeModule.d.ts +7 -0
- package/dist/module/runtime/ChunkNameRuntimeModule.js +40 -0
- package/dist/module/runtime/CompatGetDefaultExportRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/CompatGetDefaultExportRuntimeModule.js +54 -0
- package/dist/module/runtime/CompatRuntimeModule.d.ts +7 -0
- package/dist/module/runtime/CompatRuntimeModule.js +59 -0
- package/dist/module/runtime/CreateFakeNamespaceObjectRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/CreateFakeNamespaceObjectRuntimeModule.js +77 -0
- package/dist/module/runtime/CreateScriptRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/CreateScriptRuntimeModule.js +44 -0
- package/dist/module/runtime/CreateScriptUrlRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/CreateScriptUrlRuntimeModule.js +44 -0
- package/dist/module/runtime/DefinePropertyGettersRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/DefinePropertyGettersRuntimeModule.js +56 -0
- package/dist/module/runtime/EnsureChunkRuntimeModule.d.ts +7 -0
- package/dist/module/runtime/EnsureChunkRuntimeModule.js +66 -0
- package/dist/module/runtime/GetChunkFilenameRuntimeModule.d.ts +10 -0
- package/dist/module/runtime/GetChunkFilenameRuntimeModule.js +220 -0
- package/dist/module/runtime/GetFullHashRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/GetFullHashRuntimeModule.js +42 -0
- package/dist/module/runtime/GetMainFilenameRuntimeModule.d.ts +8 -0
- package/dist/module/runtime/GetMainFilenameRuntimeModule.js +52 -0
- package/dist/module/runtime/GetTrustedTypesPolicyRuntimeModule.d.ts +7 -0
- package/dist/module/runtime/GetTrustedTypesPolicyRuntimeModule.js +89 -0
- package/dist/module/runtime/GlobalRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/GlobalRuntimeModule.js +61 -0
- package/dist/module/runtime/HasOwnPropertyRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/HasOwnPropertyRuntimeModule.js +44 -0
- package/dist/module/runtime/HelperRuntimeModule.d.ts +5 -0
- package/dist/module/runtime/HelperRuntimeModule.js +12 -0
- package/dist/module/runtime/LoadScriptRuntimeModule.d.ts +9 -0
- package/dist/module/runtime/LoadScriptRuntimeModule.js +129 -0
- package/dist/module/runtime/MakeNamespaceObjectRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/MakeNamespaceObjectRuntimeModule.js +53 -0
- package/dist/module/runtime/NonceRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/NonceRuntimeModule.js +39 -0
- package/dist/module/runtime/OnChunksLoadedRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/OnChunksLoadedRuntimeModule.js +81 -0
- package/dist/module/runtime/PublicPathRuntimeModule.d.ts +7 -0
- package/dist/module/runtime/PublicPathRuntimeModule.js +44 -0
- package/dist/module/runtime/RelativeUrlRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/RelativeUrlRuntimeModule.js +56 -0
- package/dist/module/runtime/RuntimeIdRuntimeModule.d.ts +6 -0
- package/dist/module/runtime/RuntimeIdRuntimeModule.js +45 -0
- package/dist/module/runtime/StartupChunkDependenciesPlugin.d.ts +11 -0
- package/dist/module/runtime/StartupChunkDependenciesPlugin.js +69 -0
- package/dist/module/runtime/StartupChunkDependenciesRuntimeModule.d.ts +7 -0
- package/dist/module/runtime/StartupChunkDependenciesRuntimeModule.js +67 -0
- package/dist/module/runtime/StartupEntrypointRuntimeModule.d.ts +7 -0
- package/dist/module/runtime/StartupEntrypointRuntimeModule.js +58 -0
- package/dist/module/uri/DataUriPlugin.d.ts +4 -0
- package/dist/module/uri/DataUriPlugin.js +46 -0
- package/dist/module/uri/FileUriPlugin.d.ts +4 -0
- package/dist/module/uri/FileUriPlugin.js +31 -0
- package/dist/plugins/APIPlugin.d.ts +9 -0
- package/dist/plugins/APIPlugin.js +230 -0
- package/dist/plugins/CleanPlugin.d.ts +7 -0
- package/dist/plugins/CleanPlugin.js +295 -0
- package/dist/plugins/CompatibilityPlugin.d.ts +4 -0
- package/dist/plugins/CompatibilityPlugin.js +142 -0
- package/dist/plugins/ConstPlugin.d.ts +4 -0
- package/dist/plugins/ConstPlugin.js +409 -0
- package/dist/plugins/DefaultStatsFactoryPlugin.d.ts +4 -0
- package/dist/plugins/DefaultStatsFactoryPlugin.js +1552 -0
- package/dist/plugins/DefaultStatsPresetPlugin.d.ts +4 -0
- package/dist/plugins/DefaultStatsPresetPlugin.js +306 -0
- package/dist/plugins/DefaultStatsPrinterPlugin.d.ts +4 -0
- package/dist/plugins/DefaultStatsPrinterPlugin.js +986 -0
- package/dist/plugins/DefinePlugin.d.ts +15 -0
- package/dist/plugins/DefinePlugin.js +400 -0
- package/dist/plugins/NodeStuffPlugin.d.ts +6 -0
- package/dist/plugins/NodeStuffPlugin.js +134 -0
- package/dist/plugins/ProgressPlugin.d.ts +20 -0
- package/dist/plugins/ProgressPlugin.js +494 -0
- package/dist/plugins/RecordIdsPlugin.d.ts +9 -0
- package/dist/plugins/RecordIdsPlugin.js +175 -0
- package/dist/plugins/UseStrictPlugin.d.ts +4 -0
- package/dist/plugins/UseStrictPlugin.js +35 -0
- package/dist/plugins/WarnCaseSensitiveModulesPlugin.d.ts +4 -0
- package/dist/plugins/WarnCaseSensitiveModulesPlugin.js +37 -0
- package/dist/plugins/WarnDeprecatedOptionPlugin.d.ts +8 -0
- package/dist/plugins/WarnDeprecatedOptionPlugin.js +29 -0
- package/dist/plugins/cssMinimizer/CssMinimizerMinify.js +73 -0
- package/dist/plugins/cssMinimizer/CssMinimizerPlugin.d.ts +11 -0
- package/dist/plugins/cssMinimizer/CssMinimizerPlugin.js +329 -0
- package/dist/plugins/cssMinimizer/CssMinimizerUtils.js +147 -0
- package/dist/plugins/miniCssExtractPlugin/MiniCssExtractLoader.d.ts +1 -0
- package/dist/plugins/miniCssExtractPlugin/MiniCssExtractLoader.js +177 -0
- package/dist/plugins/miniCssExtractPlugin/MiniCssExtractPlugin.d.ts +22 -0
- package/dist/plugins/miniCssExtractPlugin/MiniCssExtractPlugin.js +780 -0
- package/dist/plugins/miniCssExtractPlugin/MiniCssUtils.d.ts +14 -0
- package/dist/plugins/miniCssExtractPlugin/MiniCssUtils.js +132 -0
- package/dist/plugins/optimize/AggressiveMergingPlugin.d.ts +6 -0
- package/dist/plugins/optimize/AggressiveMergingPlugin.js +62 -0
- package/dist/plugins/optimize/AggressiveSplittingPlugin.d.ts +7 -0
- package/dist/plugins/optimize/AggressiveSplittingPlugin.js +247 -0
- package/dist/plugins/optimize/ConcatenatedModule.d.ts +47 -0
- package/dist/plugins/optimize/ConcatenatedModule.js +1221 -0
- package/dist/plugins/optimize/EnsureChunkConditionsPlugin.d.ts +4 -0
- package/dist/plugins/optimize/EnsureChunkConditionsPlugin.js +61 -0
- package/dist/plugins/optimize/FlagAllModulesAsUsedPlugin.d.ts +6 -0
- package/dist/plugins/optimize/FlagAllModulesAsUsedPlugin.js +30 -0
- package/dist/plugins/optimize/FlagDependencyExportsPlugin.d.ts +4 -0
- package/dist/plugins/optimize/FlagDependencyExportsPlugin.js +275 -0
- package/dist/plugins/optimize/FlagDependencyUsagePlugin.d.ts +6 -0
- package/dist/plugins/optimize/FlagDependencyUsagePlugin.js +243 -0
- package/dist/plugins/optimize/FlagEntryExportAsUsedPlugin.d.ts +7 -0
- package/dist/plugins/optimize/FlagEntryExportAsUsedPlugin.js +34 -0
- package/dist/plugins/optimize/FlagIncludedChunksPlugin.d.ts +4 -0
- package/dist/plugins/optimize/FlagIncludedChunksPlugin.js +85 -0
- package/dist/plugins/optimize/InnerGraph.d.ts +20 -0
- package/dist/plugins/optimize/InnerGraph.js +234 -0
- package/dist/plugins/optimize/InnerGraphPlugin.d.ts +4 -0
- package/dist/plugins/optimize/InnerGraphPlugin.js +289 -0
- package/dist/plugins/optimize/LimitChunkCountPlugin.d.ts +6 -0
- package/dist/plugins/optimize/LimitChunkCountPlugin.js +200 -0
- package/dist/plugins/optimize/MangleExportsPlugin.d.ts +6 -0
- package/dist/plugins/optimize/MangleExportsPlugin.js +124 -0
- package/dist/plugins/optimize/MergeDuplicateChunksPlugin.d.ts +4 -0
- package/dist/plugins/optimize/MergeDuplicateChunksPlugin.js +84 -0
- package/dist/plugins/optimize/MinChunkSizePlugin.d.ts +6 -0
- package/dist/plugins/optimize/MinChunkSizePlugin.js +71 -0
- package/dist/plugins/optimize/ModuleConcatenationPlugin.d.ts +8 -0
- package/dist/plugins/optimize/ModuleConcatenationPlugin.js +525 -0
- package/dist/plugins/optimize/ModuleInfoHeaderPlugin.d.ts +6 -0
- package/dist/plugins/optimize/ModuleInfoHeaderPlugin.js +145 -0
- package/dist/plugins/optimize/NoEmitOnErrorsPlugin.d.ts +4 -0
- package/dist/plugins/optimize/NoEmitOnErrorsPlugin.js +17 -0
- package/dist/plugins/optimize/OptimizationStages.d.ts +4 -0
- package/dist/plugins/optimize/OptimizationStages.js +9 -0
- package/dist/plugins/optimize/RealContentHashPlugin.d.ts +11 -0
- package/dist/plugins/optimize/RealContentHashPlugin.js +295 -0
- package/dist/plugins/optimize/RemoveEmptyChunksPlugin.d.ts +4 -0
- package/dist/plugins/optimize/RemoveEmptyChunksPlugin.js +30 -0
- package/dist/plugins/optimize/RemoveParentModulesPlugin.d.ts +4 -0
- package/dist/plugins/optimize/RemoveParentModulesPlugin.js +103 -0
- package/dist/plugins/optimize/RuntimeChunkPlugin.d.ts +6 -0
- package/dist/plugins/optimize/RuntimeChunkPlugin.js +25 -0
- package/dist/plugins/optimize/SideEffectsFlagPlugin.d.ts +7 -0
- package/dist/plugins/optimize/SideEffectsFlagPlugin.js +211 -0
- package/dist/plugins/optimize/SplitChunksPlugin.d.ts +7 -0
- package/dist/plugins/optimize/SplitChunksPlugin.js +1113 -0
- package/dist/rules/BasicEffectRulePlugin.d.ts +7 -0
- package/dist/rules/BasicEffectRulePlugin.js +21 -0
- package/dist/rules/BasicMatcherRulePlugin.d.ts +8 -0
- package/dist/rules/BasicMatcherRulePlugin.js +25 -0
- package/dist/rules/ObjectMatcherRulePlugin.d.ts +7 -0
- package/dist/rules/ObjectMatcherRulePlugin.js +27 -0
- package/dist/rules/RuleSetCompiler.d.ts +20 -0
- package/dist/rules/RuleSetCompiler.js +242 -0
- package/dist/rules/UseEffectRulePlugin.d.ts +5 -0
- package/dist/rules/UseEffectRulePlugin.js +117 -0
- package/dist/serialization/Serialization.d.ts +11 -0
- package/dist/serialization/Serialization.js +95 -0
- package/dist/serialization/Serializer.d.ts +9 -0
- package/dist/serialization/Serializer.js +43 -0
- package/dist/serialization/SerializerMiddleware.d.ts +13 -0
- package/dist/serialization/SerializerMiddleware.js +86 -0
- package/dist/serialization/internalSerializables.d.ts +82 -0
- package/dist/serialization/internalSerializables.js +94 -0
- package/dist/serialization/makeSerializable.d.ts +2 -0
- package/dist/serialization/makeSerializable.js +25 -0
- package/dist/serialization/middlewares/BinaryMiddleware.d.ts +12 -0
- package/dist/serialization/middlewares/BinaryMiddleware.js +955 -0
- package/dist/serialization/middlewares/FileMiddleware.d.ts +9 -0
- package/dist/serialization/middlewares/FileMiddleware.js +546 -0
- package/dist/serialization/middlewares/ObjectMiddleware.d.ts +15 -0
- package/dist/serialization/middlewares/ObjectMiddleware.js +602 -0
- package/dist/serialization/middlewares/SingleItemMiddleware.d.ts +6 -0
- package/dist/serialization/middlewares/SingleItemMiddleware.js +15 -0
- package/dist/serialization/registerExternalSerializer.d.ts +1 -0
- package/dist/serialization/registerExternalSerializer.js +154 -0
- package/dist/serialization/serializers/ArraySerializer.d.ts +5 -0
- package/dist/serialization/serializers/ArraySerializer.js +18 -0
- package/dist/serialization/serializers/DateObjectSerializer.d.ts +5 -0
- package/dist/serialization/serializers/DateObjectSerializer.js +11 -0
- package/dist/serialization/serializers/ErrorObjectSerializer.d.ts +7 -0
- package/dist/serialization/serializers/ErrorObjectSerializer.js +20 -0
- package/dist/serialization/serializers/MapObjectSerializer.d.ts +5 -0
- package/dist/serialization/serializers/MapObjectSerializer.js +26 -0
- package/dist/serialization/serializers/NullPrototypeObjectSerializer.d.ts +5 -0
- package/dist/serialization/serializers/NullPrototypeObjectSerializer.js +28 -0
- package/dist/serialization/serializers/PlainObjectSerializer.d.ts +5 -0
- package/dist/serialization/serializers/PlainObjectSerializer.js +77 -0
- package/dist/serialization/serializers/RegExpObjectSerializer.d.ts +5 -0
- package/dist/serialization/serializers/RegExpObjectSerializer.js +12 -0
- package/dist/serialization/serializers/SetObjectSerializer.d.ts +5 -0
- package/dist/serialization/serializers/SetObjectSerializer.js +19 -0
- package/dist/sourcemap/EvalDevToolModulePlugin.d.ts +8 -0
- package/dist/sourcemap/EvalDevToolModulePlugin.js +97 -0
- package/dist/sourcemap/EvalSourceMapDevToolPlugin.d.ts +9 -0
- package/dist/sourcemap/EvalSourceMapDevToolPlugin.js +167 -0
- package/dist/sourcemap/SourceMapDevToolModuleOptionsPlugin.d.ts +6 -0
- package/dist/sourcemap/SourceMapDevToolModuleOptionsPlugin.js +29 -0
- package/dist/sourcemap/SourceMapDevToolPlugin.d.ts +11 -0
- package/dist/sourcemap/SourceMapDevToolPlugin.js +364 -0
- package/dist/template/ChunkTemplate.d.ts +6 -0
- package/dist/template/ChunkTemplate.js +69 -0
- package/dist/template/LibraryTemplatePlugin.d.ts +6 -0
- package/dist/template/LibraryTemplatePlugin.js +23 -0
- package/dist/template/MainTemplate.d.ts +10 -0
- package/dist/template/MainTemplate.js +177 -0
- package/dist/template/ModuleTemplate.d.ts +7 -0
- package/dist/template/ModuleTemplate.js +46 -0
- package/dist/template/RuntimeTemplate.d.ts +158 -0
- package/dist/template/RuntimeTemplate.js +663 -0
- package/dist/template/Template.d.ts +25 -0
- package/dist/template/Template.js +269 -0
- package/dist/template/TemplatedPathPlugin.d.ts +4 -0
- package/dist/template/TemplatedPathPlugin.js +228 -0
- package/dist/thread/WorkerError.d.ts +4 -0
- package/dist/thread/WorkerError.js +21 -0
- package/dist/thread/WorkerPool.d.ts +52 -0
- package/dist/thread/WorkerPool.js +370 -0
- package/dist/thread/readBuffer.d.ts +1 -0
- package/dist/thread/readBuffer.js +37 -0
- package/dist/thread/serializer.d.ts +2 -0
- package/dist/thread/serializer.js +24 -0
- package/dist/thread/worker.d.ts +1 -0
- package/dist/thread/worker.js +185 -0
- package/dist/thread/workerPools.d.ts +2 -0
- package/dist/thread/workerPools.js +31 -0
- package/dist/types/index.d.ts +58 -0
- package/dist/types/index.js +8 -0
- package/package.json +96 -0
|
@@ -0,0 +1,1113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Chunk_1 = __importDefault(require("@/chunk/Chunk"));
|
|
7
|
+
const OptimizationStages_1 = require("@/plugins/optimize/OptimizationStages");
|
|
8
|
+
const BaseError_1 = __importDefault(require("@/base/errors/BaseError"));
|
|
9
|
+
const SetHelpers_1 = require("@/base/SetHelpers");
|
|
10
|
+
const SortableSet_1 = __importDefault(require("@/base/SortableSet"));
|
|
11
|
+
const comparators_1 = require("@/base/comparators");
|
|
12
|
+
const createHash_1 = __importDefault(require("@/base/createHash"));
|
|
13
|
+
const deterministicGrouping_1 = __importDefault(require("@/base/deterministicGrouping"));
|
|
14
|
+
const identifier_1 = require("@/base/identifier");
|
|
15
|
+
const memoize_1 = __importDefault(require("@/base/memoize"));
|
|
16
|
+
const IdHelpers_1 = require("../../ids/IdHelpers");
|
|
17
|
+
const MinMaxSizeWarning_1 = __importDefault(require("../../base/errors/MinMaxSizeWarning"));
|
|
18
|
+
const defaultGetName = () => { };
|
|
19
|
+
const deterministicGroupingForModules = deterministicGrouping_1.default;
|
|
20
|
+
const getKeyCache = new WeakMap();
|
|
21
|
+
const hashFilename = (name, outputOptions) => {
|
|
22
|
+
const digest = (0, createHash_1.default)(outputOptions.hashFunction)
|
|
23
|
+
.update(name)
|
|
24
|
+
.digest(outputOptions.hashDigest);
|
|
25
|
+
return digest.slice(0, 8);
|
|
26
|
+
};
|
|
27
|
+
const getRequests = chunk => {
|
|
28
|
+
let requests = 0;
|
|
29
|
+
for (const chunkGroup of chunk.groupsIterable) {
|
|
30
|
+
requests = Math.max(requests, chunkGroup.chunks.length);
|
|
31
|
+
}
|
|
32
|
+
return requests;
|
|
33
|
+
};
|
|
34
|
+
const mapObject = (obj, fn) => {
|
|
35
|
+
const newObj = Object.create(null);
|
|
36
|
+
for (const key of Object.keys(obj)) {
|
|
37
|
+
newObj[key] = fn(obj[key], key);
|
|
38
|
+
}
|
|
39
|
+
return newObj;
|
|
40
|
+
};
|
|
41
|
+
const isOverlap = (a, b) => {
|
|
42
|
+
for (const item of a) {
|
|
43
|
+
if (b.has(item))
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
return false;
|
|
47
|
+
};
|
|
48
|
+
const compareModuleIterables = (0, comparators_1.compareIterables)(comparators_1.compareModulesByIdentifier);
|
|
49
|
+
const compareEntries = (a, b) => {
|
|
50
|
+
// 1. by priority
|
|
51
|
+
const diffPriority = a.cacheGroup.priority - b.cacheGroup.priority;
|
|
52
|
+
if (diffPriority)
|
|
53
|
+
return diffPriority;
|
|
54
|
+
// 2. by number of chunks
|
|
55
|
+
const diffCount = a.chunks.size - b.chunks.size;
|
|
56
|
+
if (diffCount)
|
|
57
|
+
return diffCount;
|
|
58
|
+
// 3. by size reduction
|
|
59
|
+
const aSizeReduce = totalSize(a.sizes) * (a.chunks.size - 1);
|
|
60
|
+
const bSizeReduce = totalSize(b.sizes) * (b.chunks.size - 1);
|
|
61
|
+
const diffSizeReduce = aSizeReduce - bSizeReduce;
|
|
62
|
+
if (diffSizeReduce)
|
|
63
|
+
return diffSizeReduce;
|
|
64
|
+
// 4. by cache group index
|
|
65
|
+
const indexDiff = b.cacheGroupIndex - a.cacheGroupIndex;
|
|
66
|
+
if (indexDiff)
|
|
67
|
+
return indexDiff;
|
|
68
|
+
// 5. by number of modules (to be able to compare by identifier)
|
|
69
|
+
const modulesA = a.modules;
|
|
70
|
+
const modulesB = b.modules;
|
|
71
|
+
const diff = modulesA.size - modulesB.size;
|
|
72
|
+
if (diff)
|
|
73
|
+
return diff;
|
|
74
|
+
// 6. by module identifiers
|
|
75
|
+
modulesA.sort();
|
|
76
|
+
modulesB.sort();
|
|
77
|
+
return compareModuleIterables(modulesA, modulesB);
|
|
78
|
+
};
|
|
79
|
+
const INITIAL_CHUNK_FILTER = chunk => chunk.canBeInitial();
|
|
80
|
+
const ASYNC_CHUNK_FILTER = chunk => !chunk.canBeInitial();
|
|
81
|
+
const ALL_CHUNK_FILTER = chunk => true;
|
|
82
|
+
const normalizeSizes = (value, defaultSizeTypes) => {
|
|
83
|
+
if (typeof value === 'number') {
|
|
84
|
+
const o = {};
|
|
85
|
+
for (const sizeType of defaultSizeTypes)
|
|
86
|
+
o[sizeType] = value;
|
|
87
|
+
return o;
|
|
88
|
+
}
|
|
89
|
+
if (typeof value === 'object' && value !== null) {
|
|
90
|
+
return Object.assign({}, value);
|
|
91
|
+
}
|
|
92
|
+
return {};
|
|
93
|
+
};
|
|
94
|
+
const mergeSizes = (...sizes) => {
|
|
95
|
+
let merged = {};
|
|
96
|
+
for (let i = sizes.length - 1; i >= 0; i--) {
|
|
97
|
+
merged = Object.assign(merged, sizes[i]);
|
|
98
|
+
}
|
|
99
|
+
return merged;
|
|
100
|
+
};
|
|
101
|
+
const hasNonZeroSizes = sizes => {
|
|
102
|
+
for (const key of Object.keys(sizes)) {
|
|
103
|
+
if (sizes[key] > 0)
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
return false;
|
|
107
|
+
};
|
|
108
|
+
const combineSizes = (a, b, combine) => {
|
|
109
|
+
const aKeys = new Set(Object.keys(a));
|
|
110
|
+
const bKeys = new Set(Object.keys(b));
|
|
111
|
+
const result = {};
|
|
112
|
+
for (const key of aKeys) {
|
|
113
|
+
if (bKeys.has(key)) {
|
|
114
|
+
result[key] = combine(a[key], b[key]);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
result[key] = a[key];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
for (const key of bKeys) {
|
|
121
|
+
if (!aKeys.has(key)) {
|
|
122
|
+
result[key] = b[key];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return result;
|
|
126
|
+
};
|
|
127
|
+
const checkMinSize = (sizes, minSize) => {
|
|
128
|
+
for (const key of Object.keys(minSize)) {
|
|
129
|
+
const size = sizes[key];
|
|
130
|
+
if (size === undefined || size === 0)
|
|
131
|
+
continue;
|
|
132
|
+
if (size < minSize[key])
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
return true;
|
|
136
|
+
};
|
|
137
|
+
const checkMinSizeReduction = (sizes, minSizeReduction, chunkCount) => {
|
|
138
|
+
for (const key of Object.keys(minSizeReduction)) {
|
|
139
|
+
const size = sizes[key];
|
|
140
|
+
if (size === undefined || size === 0)
|
|
141
|
+
continue;
|
|
142
|
+
if (size * chunkCount < minSizeReduction[key])
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
return true;
|
|
146
|
+
};
|
|
147
|
+
const getViolatingMinSizes = (sizes, minSize) => {
|
|
148
|
+
let list;
|
|
149
|
+
for (const key of Object.keys(minSize)) {
|
|
150
|
+
const size = sizes[key];
|
|
151
|
+
if (size === undefined || size === 0)
|
|
152
|
+
continue;
|
|
153
|
+
if (size < minSize[key]) {
|
|
154
|
+
if (list === undefined)
|
|
155
|
+
list = [key];
|
|
156
|
+
else
|
|
157
|
+
list.push(key);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return list;
|
|
161
|
+
};
|
|
162
|
+
const totalSize = sizes => {
|
|
163
|
+
let size = 0;
|
|
164
|
+
for (const key of Object.keys(sizes)) {
|
|
165
|
+
size += sizes[key];
|
|
166
|
+
}
|
|
167
|
+
return size;
|
|
168
|
+
};
|
|
169
|
+
const normalizeName = name => {
|
|
170
|
+
if (typeof name === 'string') {
|
|
171
|
+
return () => name;
|
|
172
|
+
}
|
|
173
|
+
if (typeof name === 'function') {
|
|
174
|
+
return name;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const normalizeChunksFilter = chunks => {
|
|
178
|
+
if (chunks === 'initial') {
|
|
179
|
+
return INITIAL_CHUNK_FILTER;
|
|
180
|
+
}
|
|
181
|
+
if (chunks === 'async') {
|
|
182
|
+
return ASYNC_CHUNK_FILTER;
|
|
183
|
+
}
|
|
184
|
+
if (chunks === 'all') {
|
|
185
|
+
return ALL_CHUNK_FILTER;
|
|
186
|
+
}
|
|
187
|
+
if (chunks instanceof RegExp) {
|
|
188
|
+
return chunk => chunk.name ? chunks.test(chunk.name) : false;
|
|
189
|
+
}
|
|
190
|
+
if (typeof chunks === 'function') {
|
|
191
|
+
return chunks;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
const normalizeCacheGroups = (cacheGroups, defaultSizeTypes) => {
|
|
195
|
+
if (typeof cacheGroups === 'function') {
|
|
196
|
+
return cacheGroups;
|
|
197
|
+
}
|
|
198
|
+
if (typeof cacheGroups === 'object' && cacheGroups !== null) {
|
|
199
|
+
const handlers = [];
|
|
200
|
+
for (const key of Object.keys(cacheGroups)) {
|
|
201
|
+
const option = cacheGroups[key];
|
|
202
|
+
if (option === false) {
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (typeof option === 'string' || option instanceof RegExp) {
|
|
206
|
+
const source = createCacheGroupSource({}, key, defaultSizeTypes);
|
|
207
|
+
handlers.push((module, context, results) => {
|
|
208
|
+
if (checkTest(option, module, context)) {
|
|
209
|
+
results.push(source);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
else if (typeof option === 'function') {
|
|
214
|
+
const cache = new WeakMap();
|
|
215
|
+
handlers.push((module, context, results) => {
|
|
216
|
+
const result = option(module);
|
|
217
|
+
if (result) {
|
|
218
|
+
const groups = Array.isArray(result) ? result : [result];
|
|
219
|
+
for (const group of groups) {
|
|
220
|
+
const cachedSource = cache.get(group);
|
|
221
|
+
if (cachedSource !== undefined) {
|
|
222
|
+
results.push(cachedSource);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
const source = createCacheGroupSource(group, key, defaultSizeTypes);
|
|
226
|
+
cache.set(group, source);
|
|
227
|
+
results.push(source);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
const source = createCacheGroupSource(option, key, defaultSizeTypes);
|
|
235
|
+
handlers.push((module, context, results) => {
|
|
236
|
+
if (checkTest(option.test, module, context) &&
|
|
237
|
+
checkModuleType(option.type, module) &&
|
|
238
|
+
checkModuleLayer(option.layer, module)) {
|
|
239
|
+
results.push(source);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const fn = (module, context) => {
|
|
245
|
+
const results = [];
|
|
246
|
+
for (const fn of handlers) {
|
|
247
|
+
fn(module, context, results);
|
|
248
|
+
}
|
|
249
|
+
return results;
|
|
250
|
+
};
|
|
251
|
+
return fn;
|
|
252
|
+
}
|
|
253
|
+
return () => null;
|
|
254
|
+
};
|
|
255
|
+
const checkTest = (test, module, context) => {
|
|
256
|
+
if (test === undefined)
|
|
257
|
+
return true;
|
|
258
|
+
if (typeof test === 'function') {
|
|
259
|
+
return test(module, context);
|
|
260
|
+
}
|
|
261
|
+
if (typeof test === 'boolean')
|
|
262
|
+
return test;
|
|
263
|
+
if (typeof test === 'string') {
|
|
264
|
+
const name = module.nameForCondition();
|
|
265
|
+
return name === null || name === void 0 ? void 0 : name.startsWith(test);
|
|
266
|
+
}
|
|
267
|
+
if (test instanceof RegExp) {
|
|
268
|
+
const name = module.nameForCondition();
|
|
269
|
+
return name && test.test(name);
|
|
270
|
+
}
|
|
271
|
+
return false;
|
|
272
|
+
};
|
|
273
|
+
const checkModuleType = (test, module) => {
|
|
274
|
+
if (test === undefined)
|
|
275
|
+
return true;
|
|
276
|
+
if (typeof test === 'function') {
|
|
277
|
+
return test(module.type);
|
|
278
|
+
}
|
|
279
|
+
if (typeof test === 'string') {
|
|
280
|
+
const type = module.type;
|
|
281
|
+
return test === type;
|
|
282
|
+
}
|
|
283
|
+
if (test instanceof RegExp) {
|
|
284
|
+
const type = module.type;
|
|
285
|
+
return test.test(type);
|
|
286
|
+
}
|
|
287
|
+
return false;
|
|
288
|
+
};
|
|
289
|
+
const checkModuleLayer = (test, module) => {
|
|
290
|
+
if (test === undefined)
|
|
291
|
+
return true;
|
|
292
|
+
if (typeof test === 'function') {
|
|
293
|
+
return test(module.layer);
|
|
294
|
+
}
|
|
295
|
+
if (typeof test === 'string') {
|
|
296
|
+
const layer = module.layer;
|
|
297
|
+
return test === '' ? !layer : layer === null || layer === void 0 ? void 0 : layer.startsWith(test);
|
|
298
|
+
}
|
|
299
|
+
if (test instanceof RegExp) {
|
|
300
|
+
const layer = module.layer;
|
|
301
|
+
return test.test(layer);
|
|
302
|
+
}
|
|
303
|
+
return false;
|
|
304
|
+
};
|
|
305
|
+
const createCacheGroupSource = (options, key, defaultSizeTypes) => {
|
|
306
|
+
const minSize = normalizeSizes(options.minSize, defaultSizeTypes);
|
|
307
|
+
const minSizeReduction = normalizeSizes(options.minSizeReduction, defaultSizeTypes);
|
|
308
|
+
const maxSize = normalizeSizes(options.maxSize, defaultSizeTypes);
|
|
309
|
+
return {
|
|
310
|
+
key,
|
|
311
|
+
priority: options.priority,
|
|
312
|
+
getName: normalizeName(options.name),
|
|
313
|
+
chunksFilter: normalizeChunksFilter(options.chunks),
|
|
314
|
+
enforce: options.enforce,
|
|
315
|
+
minSize,
|
|
316
|
+
minSizeReduction,
|
|
317
|
+
minRemainingSize: mergeSizes(normalizeSizes(options.minRemainingSize, defaultSizeTypes), minSize),
|
|
318
|
+
enforceSizeThreshold: normalizeSizes(options.enforceSizeThreshold, defaultSizeTypes),
|
|
319
|
+
maxAsyncSize: mergeSizes(normalizeSizes(options.maxAsyncSize, defaultSizeTypes), maxSize),
|
|
320
|
+
maxInitialSize: mergeSizes(normalizeSizes(options.maxInitialSize, defaultSizeTypes), maxSize),
|
|
321
|
+
minChunks: options.minChunks,
|
|
322
|
+
maxAsyncRequests: options.maxAsyncRequests,
|
|
323
|
+
maxInitialRequests: options.maxInitialRequests,
|
|
324
|
+
filename: options.filename,
|
|
325
|
+
idHint: options.idHint,
|
|
326
|
+
automaticNameDelimiter: options.automaticNameDelimiter,
|
|
327
|
+
reuseExistingChunk: options.reuseExistingChunk,
|
|
328
|
+
usedExports: options.usedExports,
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
class SplitChunksPlugin {
|
|
332
|
+
constructor(options = {}) {
|
|
333
|
+
const defaultSizeTypes = options.defaultSizeTypes || ['javascript', 'unknown'];
|
|
334
|
+
const fallbackCacheGroup = options.fallbackCacheGroup || {};
|
|
335
|
+
const minSize = normalizeSizes(options.minSize, defaultSizeTypes);
|
|
336
|
+
const minSizeReduction = normalizeSizes(options.minSizeReduction, defaultSizeTypes);
|
|
337
|
+
const maxSize = normalizeSizes(options.maxSize, defaultSizeTypes);
|
|
338
|
+
this.options = {
|
|
339
|
+
chunksFilter: normalizeChunksFilter(options.chunks || 'all'),
|
|
340
|
+
defaultSizeTypes,
|
|
341
|
+
minSize,
|
|
342
|
+
minSizeReduction,
|
|
343
|
+
minRemainingSize: mergeSizes(normalizeSizes(options.minRemainingSize, defaultSizeTypes), minSize),
|
|
344
|
+
enforceSizeThreshold: normalizeSizes(options.enforceSizeThreshold, defaultSizeTypes),
|
|
345
|
+
maxAsyncSize: mergeSizes(normalizeSizes(options.maxAsyncSize, defaultSizeTypes), maxSize),
|
|
346
|
+
maxInitialSize: mergeSizes(normalizeSizes(options.maxInitialSize, defaultSizeTypes), maxSize),
|
|
347
|
+
minChunks: options.minChunks || 1,
|
|
348
|
+
maxAsyncRequests: options.maxAsyncRequests || 1,
|
|
349
|
+
maxInitialRequests: options.maxInitialRequests || 1,
|
|
350
|
+
hidePathInfo: options.hidePathInfo || false,
|
|
351
|
+
filename: options.filename || undefined,
|
|
352
|
+
getCacheGroups: normalizeCacheGroups(options.cacheGroups, defaultSizeTypes),
|
|
353
|
+
getName: options.name ? normalizeName(options.name) : defaultGetName,
|
|
354
|
+
automaticNameDelimiter: options.automaticNameDelimiter,
|
|
355
|
+
usedExports: options.usedExports,
|
|
356
|
+
fallbackCacheGroup: {
|
|
357
|
+
chunksFilter: normalizeChunksFilter(fallbackCacheGroup.chunks || options.chunks || 'all'),
|
|
358
|
+
minSize: mergeSizes(normalizeSizes(fallbackCacheGroup.minSize, defaultSizeTypes), minSize),
|
|
359
|
+
maxAsyncSize: mergeSizes(normalizeSizes(fallbackCacheGroup.maxAsyncSize, defaultSizeTypes), normalizeSizes(fallbackCacheGroup.maxSize, defaultSizeTypes), normalizeSizes(options.maxAsyncSize, defaultSizeTypes), normalizeSizes(options.maxSize, defaultSizeTypes)),
|
|
360
|
+
maxInitialSize: mergeSizes(normalizeSizes(fallbackCacheGroup.maxInitialSize, defaultSizeTypes), normalizeSizes(fallbackCacheGroup.maxSize, defaultSizeTypes), normalizeSizes(options.maxInitialSize, defaultSizeTypes), normalizeSizes(options.maxSize, defaultSizeTypes)),
|
|
361
|
+
automaticNameDelimiter: fallbackCacheGroup.automaticNameDelimiter || options.automaticNameDelimiter || '~',
|
|
362
|
+
},
|
|
363
|
+
};
|
|
364
|
+
this._cacheGroupCache = new WeakMap();
|
|
365
|
+
}
|
|
366
|
+
_getCacheGroup(cacheGroupSource) {
|
|
367
|
+
const cacheEntry = this._cacheGroupCache.get(cacheGroupSource);
|
|
368
|
+
if (cacheEntry !== undefined)
|
|
369
|
+
return cacheEntry;
|
|
370
|
+
const minSize = mergeSizes(cacheGroupSource.minSize, cacheGroupSource.enforce ? undefined : this.options.minSize);
|
|
371
|
+
const minSizeReduction = mergeSizes(cacheGroupSource.minSizeReduction, cacheGroupSource.enforce ? undefined : this.options.minSizeReduction);
|
|
372
|
+
const minRemainingSize = mergeSizes(cacheGroupSource.minRemainingSize, cacheGroupSource.enforce ? undefined : this.options.minRemainingSize);
|
|
373
|
+
const enforceSizeThreshold = mergeSizes(cacheGroupSource.enforceSizeThreshold, cacheGroupSource.enforce ? undefined : this.options.enforceSizeThreshold);
|
|
374
|
+
const cacheGroup = {
|
|
375
|
+
key: cacheGroupSource.key,
|
|
376
|
+
priority: cacheGroupSource.priority || 0,
|
|
377
|
+
chunksFilter: cacheGroupSource.chunksFilter || this.options.chunksFilter,
|
|
378
|
+
minSize,
|
|
379
|
+
minSizeReduction,
|
|
380
|
+
minRemainingSize,
|
|
381
|
+
enforceSizeThreshold,
|
|
382
|
+
maxAsyncSize: mergeSizes(cacheGroupSource.maxAsyncSize, cacheGroupSource.enforce ? undefined : this.options.maxAsyncSize),
|
|
383
|
+
maxInitialSize: mergeSizes(cacheGroupSource.maxInitialSize, cacheGroupSource.enforce ? undefined : this.options.maxInitialSize),
|
|
384
|
+
minChunks: cacheGroupSource.minChunks !== undefined
|
|
385
|
+
? cacheGroupSource.minChunks
|
|
386
|
+
: cacheGroupSource.enforce
|
|
387
|
+
? 1
|
|
388
|
+
: this.options.minChunks,
|
|
389
|
+
maxAsyncRequests: cacheGroupSource.maxAsyncRequests !== undefined
|
|
390
|
+
? cacheGroupSource.maxAsyncRequests
|
|
391
|
+
: cacheGroupSource.enforce
|
|
392
|
+
? Infinity
|
|
393
|
+
: this.options.maxAsyncRequests,
|
|
394
|
+
maxInitialRequests: cacheGroupSource.maxInitialRequests !== undefined
|
|
395
|
+
? cacheGroupSource.maxInitialRequests
|
|
396
|
+
: cacheGroupSource.enforce
|
|
397
|
+
? Infinity
|
|
398
|
+
: this.options.maxInitialRequests,
|
|
399
|
+
getName: cacheGroupSource.getName !== undefined ? cacheGroupSource.getName : this.options.getName,
|
|
400
|
+
usedExports: cacheGroupSource.usedExports !== undefined
|
|
401
|
+
? cacheGroupSource.usedExports
|
|
402
|
+
: this.options.usedExports,
|
|
403
|
+
filename: cacheGroupSource.filename !== undefined ? cacheGroupSource.filename : this.options.filename,
|
|
404
|
+
automaticNameDelimiter: cacheGroupSource.automaticNameDelimiter !== undefined
|
|
405
|
+
? cacheGroupSource.automaticNameDelimiter
|
|
406
|
+
: this.options.automaticNameDelimiter,
|
|
407
|
+
idHint: cacheGroupSource.idHint !== undefined ? cacheGroupSource.idHint : cacheGroupSource.key,
|
|
408
|
+
reuseExistingChunk: cacheGroupSource.reuseExistingChunk || false,
|
|
409
|
+
_validateSize: hasNonZeroSizes(minSize),
|
|
410
|
+
_validateRemainingSize: hasNonZeroSizes(minRemainingSize),
|
|
411
|
+
_minSizeForMaxSize: mergeSizes(cacheGroupSource.minSize, this.options.minSize),
|
|
412
|
+
_conditionalEnforce: hasNonZeroSizes(enforceSizeThreshold),
|
|
413
|
+
};
|
|
414
|
+
this._cacheGroupCache.set(cacheGroupSource, cacheGroup);
|
|
415
|
+
return cacheGroup;
|
|
416
|
+
}
|
|
417
|
+
apply(compiler) {
|
|
418
|
+
const cachedMakePathsRelative = identifier_1.makePathsRelative.bindContextCache(compiler.context, compiler.root);
|
|
419
|
+
compiler.hooks.thisCompilation.tap('SplitChunksPlugin', compilation => {
|
|
420
|
+
const logger = compilation.getLogger('webpack.SplitChunksPlugin');
|
|
421
|
+
let alreadyOptimized = false;
|
|
422
|
+
compilation.hooks.unseal.tap('SplitChunksPlugin', () => {
|
|
423
|
+
alreadyOptimized = false;
|
|
424
|
+
});
|
|
425
|
+
compilation.hooks.optimizeChunks.tap({
|
|
426
|
+
name: 'SplitChunksPlugin',
|
|
427
|
+
stage: OptimizationStages_1.STAGE_ADVANCED,
|
|
428
|
+
}, chunks => {
|
|
429
|
+
if (alreadyOptimized)
|
|
430
|
+
return;
|
|
431
|
+
alreadyOptimized = true;
|
|
432
|
+
logger.time('prepare');
|
|
433
|
+
const chunkGraph = compilation.chunkGraph;
|
|
434
|
+
const moduleGraph = compilation.moduleGraph;
|
|
435
|
+
// Give each selected chunk an index (to create strings from chunks)
|
|
436
|
+
const chunkIndexMap = new Map();
|
|
437
|
+
const ZERO = BigInt('0');
|
|
438
|
+
const ONE = BigInt('1');
|
|
439
|
+
const START = ONE << BigInt('31');
|
|
440
|
+
let index = START;
|
|
441
|
+
for (const chunk of chunks) {
|
|
442
|
+
chunkIndexMap.set(chunk, index | BigInt((Math.random() * 0x7fffffff) | 0));
|
|
443
|
+
index <<= ONE;
|
|
444
|
+
}
|
|
445
|
+
const getKey = chunks => {
|
|
446
|
+
const iterator = chunks[Symbol.iterator]();
|
|
447
|
+
let result = iterator.next();
|
|
448
|
+
if (result.done)
|
|
449
|
+
return ZERO;
|
|
450
|
+
const first = result.value;
|
|
451
|
+
result = iterator.next();
|
|
452
|
+
if (result.done)
|
|
453
|
+
return first;
|
|
454
|
+
let key = chunkIndexMap.get(first) | chunkIndexMap.get(result.value);
|
|
455
|
+
while (!(result = iterator.next()).done) {
|
|
456
|
+
const raw = chunkIndexMap.get(result.value);
|
|
457
|
+
key ^= raw;
|
|
458
|
+
}
|
|
459
|
+
return key;
|
|
460
|
+
};
|
|
461
|
+
const keyToString = key => {
|
|
462
|
+
if (typeof key === 'bigint')
|
|
463
|
+
return key.toString(16);
|
|
464
|
+
return chunkIndexMap.get(key).toString(16);
|
|
465
|
+
};
|
|
466
|
+
const getChunkSetsInGraph = (0, memoize_1.default)(() => {
|
|
467
|
+
const chunkSetsInGraph = new Map();
|
|
468
|
+
const singleChunkSets = new Set();
|
|
469
|
+
for (const module of compilation.modules) {
|
|
470
|
+
const chunks = chunkGraph.getModuleChunksIterable(module);
|
|
471
|
+
const chunksKey = getKey(chunks);
|
|
472
|
+
if (typeof chunksKey === 'bigint') {
|
|
473
|
+
if (!chunkSetsInGraph.has(chunksKey)) {
|
|
474
|
+
chunkSetsInGraph.set(chunksKey, new Set(chunks));
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
singleChunkSets.add(chunksKey);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return { chunkSetsInGraph, singleChunkSets };
|
|
482
|
+
});
|
|
483
|
+
const groupChunksByExports = module => {
|
|
484
|
+
const exportsInfo = moduleGraph.getExportsInfo(module);
|
|
485
|
+
const groupedByUsedExports = new Map();
|
|
486
|
+
for (const chunk of chunkGraph.getModuleChunksIterable(module)) {
|
|
487
|
+
const key = exportsInfo.getUsageKey(chunk.runtime);
|
|
488
|
+
const list = groupedByUsedExports.get(key);
|
|
489
|
+
if (list !== undefined) {
|
|
490
|
+
list.push(chunk);
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
groupedByUsedExports.set(key, [chunk]);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return groupedByUsedExports.values();
|
|
497
|
+
};
|
|
498
|
+
const groupedByExportsMap = new Map();
|
|
499
|
+
const getExportsChunkSetsInGraph = (0, memoize_1.default)(() => {
|
|
500
|
+
const chunkSetsInGraph = new Map();
|
|
501
|
+
const singleChunkSets = new Set();
|
|
502
|
+
for (const module of compilation.modules) {
|
|
503
|
+
const groupedChunks = Array.from(groupChunksByExports(module));
|
|
504
|
+
groupedByExportsMap.set(module, groupedChunks);
|
|
505
|
+
for (const chunks of groupedChunks) {
|
|
506
|
+
if (chunks.length === 1) {
|
|
507
|
+
singleChunkSets.add(chunks[0]);
|
|
508
|
+
}
|
|
509
|
+
else {
|
|
510
|
+
const chunksKey = getKey(chunks);
|
|
511
|
+
if (!chunkSetsInGraph.has(chunksKey)) {
|
|
512
|
+
chunkSetsInGraph.set(chunksKey, new Set(chunks));
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
return { chunkSetsInGraph, singleChunkSets };
|
|
518
|
+
});
|
|
519
|
+
// group these set of chunks by count
|
|
520
|
+
// to allow to check less sets via isSubset
|
|
521
|
+
// (only smaller sets can be subset)
|
|
522
|
+
const groupChunkSetsByCount = chunkSets => {
|
|
523
|
+
const chunkSetsByCount = new Map();
|
|
524
|
+
for (const chunksSet of chunkSets) {
|
|
525
|
+
const count = chunksSet.size;
|
|
526
|
+
let array = chunkSetsByCount.get(count);
|
|
527
|
+
if (array === undefined) {
|
|
528
|
+
array = [];
|
|
529
|
+
chunkSetsByCount.set(count, array);
|
|
530
|
+
}
|
|
531
|
+
array.push(chunksSet);
|
|
532
|
+
}
|
|
533
|
+
return chunkSetsByCount;
|
|
534
|
+
};
|
|
535
|
+
const getChunkSetsByCount = (0, memoize_1.default)(() => groupChunkSetsByCount(getChunkSetsInGraph().chunkSetsInGraph.values()));
|
|
536
|
+
const getExportsChunkSetsByCount = (0, memoize_1.default)(() => groupChunkSetsByCount(getExportsChunkSetsInGraph().chunkSetsInGraph.values()));
|
|
537
|
+
// Create a list of possible combinations
|
|
538
|
+
const createGetCombinations = (chunkSets, singleChunkSets, chunkSetsByCount) => {
|
|
539
|
+
const combinationsCache = new Map();
|
|
540
|
+
return key => {
|
|
541
|
+
const cacheEntry = combinationsCache.get(key);
|
|
542
|
+
if (cacheEntry !== undefined)
|
|
543
|
+
return cacheEntry;
|
|
544
|
+
if (key instanceof Chunk_1.default) {
|
|
545
|
+
const result = [key];
|
|
546
|
+
combinationsCache.set(key, result);
|
|
547
|
+
return result;
|
|
548
|
+
}
|
|
549
|
+
const chunksSet = chunkSets.get(key);
|
|
550
|
+
const array = [chunksSet];
|
|
551
|
+
for (const [count, setArray] of chunkSetsByCount) {
|
|
552
|
+
// "equal" is not needed because they would have been merge in the first step
|
|
553
|
+
if (count < chunksSet.size) {
|
|
554
|
+
for (const set of setArray) {
|
|
555
|
+
if ((0, SetHelpers_1.isSubset)(chunksSet, set)) {
|
|
556
|
+
array.push(set);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
for (const chunk of singleChunkSets) {
|
|
562
|
+
if (chunksSet.has(chunk)) {
|
|
563
|
+
array.push(chunk);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
combinationsCache.set(key, array);
|
|
567
|
+
return array;
|
|
568
|
+
};
|
|
569
|
+
};
|
|
570
|
+
const getCombinationsFactory = (0, memoize_1.default)(() => {
|
|
571
|
+
const { chunkSetsInGraph, singleChunkSets } = getChunkSetsInGraph();
|
|
572
|
+
return createGetCombinations(chunkSetsInGraph, singleChunkSets, getChunkSetsByCount());
|
|
573
|
+
});
|
|
574
|
+
// @ts-ignore
|
|
575
|
+
const getCombinations = key => getCombinationsFactory()(key);
|
|
576
|
+
const getExportsCombinationsFactory = (0, memoize_1.default)(() => {
|
|
577
|
+
const { chunkSetsInGraph, singleChunkSets } = getExportsChunkSetsInGraph();
|
|
578
|
+
return createGetCombinations(chunkSetsInGraph, singleChunkSets, getExportsChunkSetsByCount());
|
|
579
|
+
});
|
|
580
|
+
// @ts-ignore
|
|
581
|
+
const getExportsCombinations = key => getExportsCombinationsFactory()(key);
|
|
582
|
+
const selectedChunksCacheByChunksSet = new WeakMap();
|
|
583
|
+
const getSelectedChunks = (chunks, chunkFilter) => {
|
|
584
|
+
let entry = selectedChunksCacheByChunksSet.get(chunks);
|
|
585
|
+
if (entry === undefined) {
|
|
586
|
+
entry = new WeakMap();
|
|
587
|
+
selectedChunksCacheByChunksSet.set(chunks, entry);
|
|
588
|
+
}
|
|
589
|
+
let entry2 = entry.get(chunkFilter);
|
|
590
|
+
if (entry2 === undefined) {
|
|
591
|
+
const selectedChunks = [];
|
|
592
|
+
if (chunks instanceof Chunk_1.default) {
|
|
593
|
+
if (chunkFilter(chunks))
|
|
594
|
+
selectedChunks.push(chunks);
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
for (const chunk of chunks) {
|
|
598
|
+
if (chunkFilter(chunk))
|
|
599
|
+
selectedChunks.push(chunk);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
entry2 = {
|
|
603
|
+
chunks: selectedChunks,
|
|
604
|
+
key: getKey(selectedChunks),
|
|
605
|
+
};
|
|
606
|
+
entry.set(chunkFilter, entry2);
|
|
607
|
+
}
|
|
608
|
+
return entry2;
|
|
609
|
+
};
|
|
610
|
+
const alreadyValidatedParents = new Map();
|
|
611
|
+
const alreadyReportedErrors = new Set();
|
|
612
|
+
// Map a list of chunks to a list of modules
|
|
613
|
+
// For the key the chunk "index" is used, the value is a SortableSet of modules
|
|
614
|
+
const chunksInfoMap = new Map();
|
|
615
|
+
const addModuleToChunksInfoMap = (cacheGroup, cacheGroupIndex, selectedChunks, selectedChunksKey, module) => {
|
|
616
|
+
// Break if minimum number of chunks is not reached
|
|
617
|
+
if (selectedChunks.length < cacheGroup.minChunks)
|
|
618
|
+
return;
|
|
619
|
+
// Determine name for split chunk
|
|
620
|
+
const name = cacheGroup.getName(module, selectedChunks, cacheGroup.key);
|
|
621
|
+
// Check if the name is ok
|
|
622
|
+
const existingChunk = compilation.namedChunks.get(name);
|
|
623
|
+
if (existingChunk) {
|
|
624
|
+
const parentValidationKey = `${name}|${typeof selectedChunksKey === 'bigint'
|
|
625
|
+
? selectedChunksKey
|
|
626
|
+
: selectedChunksKey.debugId}`;
|
|
627
|
+
const valid = alreadyValidatedParents.get(parentValidationKey);
|
|
628
|
+
if (valid === false)
|
|
629
|
+
return;
|
|
630
|
+
if (valid === undefined) {
|
|
631
|
+
// Module can only be moved into the existing chunk if the existing chunk
|
|
632
|
+
// is a parent of all selected chunks
|
|
633
|
+
let isInAllParents = true;
|
|
634
|
+
const queue = new Set();
|
|
635
|
+
for (const chunk of selectedChunks) {
|
|
636
|
+
for (const group of chunk.groupsIterable) {
|
|
637
|
+
queue.add(group);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
for (const group of queue) {
|
|
641
|
+
if (existingChunk.isInGroup(group))
|
|
642
|
+
continue;
|
|
643
|
+
let hasParent = false;
|
|
644
|
+
for (const parent of group.parentsIterable) {
|
|
645
|
+
hasParent = true;
|
|
646
|
+
queue.add(parent);
|
|
647
|
+
}
|
|
648
|
+
if (!hasParent) {
|
|
649
|
+
isInAllParents = false;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
const valid = isInAllParents;
|
|
653
|
+
alreadyValidatedParents.set(parentValidationKey, valid);
|
|
654
|
+
if (!valid) {
|
|
655
|
+
if (!alreadyReportedErrors.has(name)) {
|
|
656
|
+
alreadyReportedErrors.add(name);
|
|
657
|
+
compilation.errors.push(new BaseError_1.default('SplitChunksPlugin\n' +
|
|
658
|
+
`Cache group "${cacheGroup.key}" conflicts with existing chunk.\n` +
|
|
659
|
+
`Both have the same name "${name}" and existing chunk is not a parent of the selected modules.\n` +
|
|
660
|
+
'Use a different name for the cache group or make sure that the existing chunk is a parent (e. g. via dependOn).\n' +
|
|
661
|
+
'HINT: You can omit "name" to automatically create a name.\n' +
|
|
662
|
+
'BREAKING CHANGE: webpack < 5 used to allow to use an entrypoint as splitChunk. ' +
|
|
663
|
+
'This is no longer allowed when the entrypoint is not a parent of the selected modules.\n' +
|
|
664
|
+
"Remove this entrypoint and add modules to cache group's 'test' instead. " +
|
|
665
|
+
'If you need modules to be evaluated on startup, add them to the existing entrypoints (make them arrays). ' +
|
|
666
|
+
'See migration guide of more info.'));
|
|
667
|
+
}
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
// Create key for maps
|
|
673
|
+
// When it has a name we use the name as key
|
|
674
|
+
// Otherwise we create the key from chunks and cache group key
|
|
675
|
+
// This automatically merges equal names
|
|
676
|
+
const key = cacheGroup.key +
|
|
677
|
+
(name ? ` name:${name}` : ` chunks:${keyToString(selectedChunksKey)}`);
|
|
678
|
+
// Add module to maps
|
|
679
|
+
let info = chunksInfoMap.get(key);
|
|
680
|
+
if (info === undefined) {
|
|
681
|
+
chunksInfoMap.set(key, (info = {
|
|
682
|
+
modules: new SortableSet_1.default(undefined, comparators_1.compareModulesByIdentifier),
|
|
683
|
+
cacheGroup,
|
|
684
|
+
cacheGroupIndex,
|
|
685
|
+
name,
|
|
686
|
+
sizes: {},
|
|
687
|
+
chunks: new Set(),
|
|
688
|
+
reuseableChunks: new Set(),
|
|
689
|
+
chunksKeys: new Set(),
|
|
690
|
+
}));
|
|
691
|
+
}
|
|
692
|
+
const oldSize = info.modules.size;
|
|
693
|
+
info.modules.add(module);
|
|
694
|
+
if (info.modules.size !== oldSize) {
|
|
695
|
+
for (const type of module.getSourceTypes()) {
|
|
696
|
+
info.sizes[type] = (info.sizes[type] || 0) + module.size(type);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
const oldChunksKeysSize = info.chunksKeys.size;
|
|
700
|
+
info.chunksKeys.add(selectedChunksKey);
|
|
701
|
+
if (oldChunksKeysSize !== info.chunksKeys.size) {
|
|
702
|
+
for (const chunk of selectedChunks) {
|
|
703
|
+
info.chunks.add(chunk);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
const context = {
|
|
708
|
+
moduleGraph,
|
|
709
|
+
chunkGraph,
|
|
710
|
+
};
|
|
711
|
+
logger.timeEnd('prepare');
|
|
712
|
+
logger.time('modules');
|
|
713
|
+
// Walk through all modules
|
|
714
|
+
for (const module of compilation.modules) {
|
|
715
|
+
// Get cache group
|
|
716
|
+
const cacheGroups = this.options.getCacheGroups(module, context);
|
|
717
|
+
if (!Array.isArray(cacheGroups) || cacheGroups.length === 0) {
|
|
718
|
+
continue;
|
|
719
|
+
}
|
|
720
|
+
// Prepare some values (usedExports = false)
|
|
721
|
+
const getCombs = (0, memoize_1.default)(() => {
|
|
722
|
+
const chunks = chunkGraph.getModuleChunksIterable(module);
|
|
723
|
+
const chunksKey = getKey(chunks);
|
|
724
|
+
return getCombinations(chunksKey);
|
|
725
|
+
});
|
|
726
|
+
// Prepare some values (usedExports = true)
|
|
727
|
+
const getCombsByUsedExports = (0, memoize_1.default)(() => {
|
|
728
|
+
// fill the groupedByExportsMap
|
|
729
|
+
getExportsChunkSetsInGraph();
|
|
730
|
+
const set = new Set();
|
|
731
|
+
const groupedByUsedExports = groupedByExportsMap.get(module);
|
|
732
|
+
for (const chunks of groupedByUsedExports) {
|
|
733
|
+
const chunksKey = getKey(chunks);
|
|
734
|
+
for (const comb of getExportsCombinations(chunksKey))
|
|
735
|
+
set.add(comb);
|
|
736
|
+
}
|
|
737
|
+
return set;
|
|
738
|
+
});
|
|
739
|
+
let cacheGroupIndex = 0;
|
|
740
|
+
for (const cacheGroupSource of cacheGroups) {
|
|
741
|
+
const cacheGroup = this._getCacheGroup(cacheGroupSource);
|
|
742
|
+
const combs = cacheGroup.usedExports ? getCombsByUsedExports() : getCombs();
|
|
743
|
+
// For all combination of chunk selection
|
|
744
|
+
for (const chunkCombination of combs) {
|
|
745
|
+
// Break if minimum number of chunks is not reached
|
|
746
|
+
const count = chunkCombination instanceof Chunk_1.default ? 1 : chunkCombination.size;
|
|
747
|
+
if (count < cacheGroup.minChunks)
|
|
748
|
+
continue;
|
|
749
|
+
// Select chunks by configuration
|
|
750
|
+
const { chunks: selectedChunks, key: selectedChunksKey } = getSelectedChunks(chunkCombination, cacheGroup.chunksFilter);
|
|
751
|
+
addModuleToChunksInfoMap(cacheGroup, cacheGroupIndex, selectedChunks, selectedChunksKey, module);
|
|
752
|
+
}
|
|
753
|
+
cacheGroupIndex++;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
logger.timeEnd('modules');
|
|
757
|
+
logger.time('queue');
|
|
758
|
+
const removeModulesWithSourceType = (info, sourceTypes) => {
|
|
759
|
+
for (const module of info.modules) {
|
|
760
|
+
const types = module.getSourceTypes();
|
|
761
|
+
if (sourceTypes.some(type => types.has(type))) {
|
|
762
|
+
info.modules.delete(module);
|
|
763
|
+
for (const type of types) {
|
|
764
|
+
info.sizes[type] -= module.size(type);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
const removeMinSizeViolatingModules = info => {
|
|
770
|
+
if (!info.cacheGroup._validateSize)
|
|
771
|
+
return false;
|
|
772
|
+
const violatingSizes = getViolatingMinSizes(info.sizes, info.cacheGroup.minSize);
|
|
773
|
+
if (violatingSizes === undefined)
|
|
774
|
+
return false;
|
|
775
|
+
removeModulesWithSourceType(info, violatingSizes);
|
|
776
|
+
return info.modules.size === 0;
|
|
777
|
+
};
|
|
778
|
+
// Filter items were size < minSize
|
|
779
|
+
for (const [key, info] of chunksInfoMap) {
|
|
780
|
+
if (removeMinSizeViolatingModules(info)) {
|
|
781
|
+
chunksInfoMap.delete(key);
|
|
782
|
+
}
|
|
783
|
+
else if (!checkMinSizeReduction(info.sizes, info.cacheGroup.minSizeReduction, info.chunks.size)) {
|
|
784
|
+
chunksInfoMap.delete(key);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
const maxSizeQueueMap = new Map();
|
|
788
|
+
while (chunksInfoMap.size > 0) {
|
|
789
|
+
// Find best matching entry
|
|
790
|
+
let bestEntryKey;
|
|
791
|
+
let bestEntry;
|
|
792
|
+
for (const pair of chunksInfoMap) {
|
|
793
|
+
const key = pair[0];
|
|
794
|
+
const info = pair[1];
|
|
795
|
+
if (bestEntry === undefined || compareEntries(bestEntry, info) < 0) {
|
|
796
|
+
bestEntry = info;
|
|
797
|
+
bestEntryKey = key;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
const item = bestEntry;
|
|
801
|
+
chunksInfoMap.delete(bestEntryKey);
|
|
802
|
+
let chunkName = item.name;
|
|
803
|
+
// Variable for the new chunk (lazy created)
|
|
804
|
+
let newChunk;
|
|
805
|
+
// When no chunk name, check if we can reuse a chunk instead of creating a new one
|
|
806
|
+
let isExistingChunk = false;
|
|
807
|
+
let isReusedWithAllModules = false;
|
|
808
|
+
if (chunkName) {
|
|
809
|
+
const chunkByName = compilation.namedChunks.get(chunkName);
|
|
810
|
+
if (chunkByName !== undefined) {
|
|
811
|
+
newChunk = chunkByName;
|
|
812
|
+
const oldSize = item.chunks.size;
|
|
813
|
+
item.chunks.delete(newChunk);
|
|
814
|
+
isExistingChunk = item.chunks.size !== oldSize;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
else if (item.cacheGroup.reuseExistingChunk) {
|
|
818
|
+
outer: for (const chunk of item.chunks) {
|
|
819
|
+
if (chunkGraph.getNumberOfChunkModules(chunk) !== item.modules.size) {
|
|
820
|
+
continue;
|
|
821
|
+
}
|
|
822
|
+
if (item.chunks.size > 1 && chunkGraph.getNumberOfEntryModules(chunk) > 0) {
|
|
823
|
+
continue;
|
|
824
|
+
}
|
|
825
|
+
for (const module of item.modules) {
|
|
826
|
+
if (!chunkGraph.isModuleInChunk(module, chunk)) {
|
|
827
|
+
continue outer;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
if (!newChunk || !newChunk.name) {
|
|
831
|
+
newChunk = chunk;
|
|
832
|
+
}
|
|
833
|
+
else if (chunk.name && chunk.name.length < newChunk.name.length) {
|
|
834
|
+
newChunk = chunk;
|
|
835
|
+
}
|
|
836
|
+
else if (chunk.name &&
|
|
837
|
+
chunk.name.length === newChunk.name.length &&
|
|
838
|
+
chunk.name < newChunk.name) {
|
|
839
|
+
newChunk = chunk;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
if (newChunk) {
|
|
843
|
+
item.chunks.delete(newChunk);
|
|
844
|
+
chunkName = undefined;
|
|
845
|
+
isExistingChunk = true;
|
|
846
|
+
isReusedWithAllModules = true;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
const enforced = item.cacheGroup._conditionalEnforce &&
|
|
850
|
+
checkMinSize(item.sizes, item.cacheGroup.enforceSizeThreshold);
|
|
851
|
+
const usedChunks = new Set(item.chunks);
|
|
852
|
+
// Check if maxRequests condition can be fulfilled
|
|
853
|
+
if (!enforced &&
|
|
854
|
+
(Number.isFinite(item.cacheGroup.maxInitialRequests) ||
|
|
855
|
+
Number.isFinite(item.cacheGroup.maxAsyncRequests))) {
|
|
856
|
+
for (const chunk of usedChunks) {
|
|
857
|
+
// respect max requests
|
|
858
|
+
const maxRequests = chunk.isOnlyInitial()
|
|
859
|
+
? item.cacheGroup.maxInitialRequests
|
|
860
|
+
: chunk.canBeInitial()
|
|
861
|
+
? Math.min(item.cacheGroup.maxInitialRequests, item.cacheGroup.maxAsyncRequests)
|
|
862
|
+
: item.cacheGroup.maxAsyncRequests;
|
|
863
|
+
if (isFinite(maxRequests) && getRequests(chunk) >= maxRequests) {
|
|
864
|
+
usedChunks.delete(chunk);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
outer: for (const chunk of usedChunks) {
|
|
869
|
+
for (const module of item.modules) {
|
|
870
|
+
if (chunkGraph.isModuleInChunk(module, chunk))
|
|
871
|
+
continue outer;
|
|
872
|
+
}
|
|
873
|
+
usedChunks.delete(chunk);
|
|
874
|
+
}
|
|
875
|
+
// Were some (invalid) chunks removed from usedChunks?
|
|
876
|
+
// => readd all modules to the queue, as things could have been changed
|
|
877
|
+
if (usedChunks.size < item.chunks.size) {
|
|
878
|
+
if (isExistingChunk)
|
|
879
|
+
usedChunks.add(newChunk);
|
|
880
|
+
if (usedChunks.size >= item.cacheGroup.minChunks) {
|
|
881
|
+
const chunksArr = Array.from(usedChunks);
|
|
882
|
+
for (const module of item.modules) {
|
|
883
|
+
addModuleToChunksInfoMap(item.cacheGroup, item.cacheGroupIndex, chunksArr, getKey(usedChunks), module);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
continue;
|
|
887
|
+
}
|
|
888
|
+
// Validate minRemainingSize constraint when a single chunk is left over
|
|
889
|
+
if (!enforced && item.cacheGroup._validateRemainingSize && usedChunks.size === 1) {
|
|
890
|
+
const [chunk] = usedChunks;
|
|
891
|
+
const chunkSizes = Object.create(null);
|
|
892
|
+
for (const module of chunkGraph.getChunkModulesIterable(chunk)) {
|
|
893
|
+
if (!item.modules.has(module)) {
|
|
894
|
+
for (const type of module.getSourceTypes()) {
|
|
895
|
+
chunkSizes[type] = (chunkSizes[type] || 0) + module.size(type);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
const violatingSizes = getViolatingMinSizes(chunkSizes, item.cacheGroup.minRemainingSize);
|
|
900
|
+
if (violatingSizes !== undefined) {
|
|
901
|
+
const oldModulesSize = item.modules.size;
|
|
902
|
+
removeModulesWithSourceType(item, violatingSizes);
|
|
903
|
+
if (item.modules.size > 0 && item.modules.size !== oldModulesSize) {
|
|
904
|
+
// queue this item again to be processed again
|
|
905
|
+
// without violating modules
|
|
906
|
+
chunksInfoMap.set(bestEntryKey, item);
|
|
907
|
+
}
|
|
908
|
+
continue;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
// Create the new chunk if not reusing one
|
|
912
|
+
if (newChunk === undefined) {
|
|
913
|
+
newChunk = compilation.addChunk(chunkName);
|
|
914
|
+
}
|
|
915
|
+
// Walk through all chunks
|
|
916
|
+
for (const chunk of usedChunks) {
|
|
917
|
+
// Add graph connections for splitted chunk
|
|
918
|
+
chunk.split(newChunk);
|
|
919
|
+
}
|
|
920
|
+
// Add a note to the chunk
|
|
921
|
+
newChunk.chunkReason =
|
|
922
|
+
(newChunk.chunkReason ? `${newChunk.chunkReason}, ` : '') +
|
|
923
|
+
(isReusedWithAllModules ? 'reused as split chunk' : 'split chunk');
|
|
924
|
+
if (item.cacheGroup.key) {
|
|
925
|
+
newChunk.chunkReason += ` (cache group: ${item.cacheGroup.key})`;
|
|
926
|
+
}
|
|
927
|
+
if (chunkName) {
|
|
928
|
+
newChunk.chunkReason += ` (name: ${chunkName})`;
|
|
929
|
+
}
|
|
930
|
+
if (item.cacheGroup.filename) {
|
|
931
|
+
newChunk.filenameTemplate = item.cacheGroup.filename;
|
|
932
|
+
}
|
|
933
|
+
if (item.cacheGroup.idHint) {
|
|
934
|
+
newChunk.idNameHints.add(item.cacheGroup.idHint);
|
|
935
|
+
}
|
|
936
|
+
if (!isReusedWithAllModules) {
|
|
937
|
+
// Add all modules to the new chunk
|
|
938
|
+
for (const module of item.modules) {
|
|
939
|
+
if (!module.chunkCondition(newChunk, compilation))
|
|
940
|
+
continue;
|
|
941
|
+
// Add module to new chunk
|
|
942
|
+
chunkGraph.connectChunkAndModule(newChunk, module);
|
|
943
|
+
// Remove module from used chunks
|
|
944
|
+
for (const chunk of usedChunks) {
|
|
945
|
+
chunkGraph.disconnectChunkAndModule(chunk, module);
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
else {
|
|
950
|
+
// Remove all modules from used chunks
|
|
951
|
+
for (const module of item.modules) {
|
|
952
|
+
for (const chunk of usedChunks) {
|
|
953
|
+
chunkGraph.disconnectChunkAndModule(chunk, module);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
if (Object.keys(item.cacheGroup.maxAsyncSize).length > 0 ||
|
|
958
|
+
Object.keys(item.cacheGroup.maxInitialSize).length > 0) {
|
|
959
|
+
const oldMaxSizeSettings = maxSizeQueueMap.get(newChunk);
|
|
960
|
+
maxSizeQueueMap.set(newChunk, {
|
|
961
|
+
minSize: oldMaxSizeSettings
|
|
962
|
+
? combineSizes(oldMaxSizeSettings.minSize, item.cacheGroup._minSizeForMaxSize, Math.max)
|
|
963
|
+
: item.cacheGroup.minSize,
|
|
964
|
+
maxAsyncSize: oldMaxSizeSettings
|
|
965
|
+
? combineSizes(oldMaxSizeSettings.maxAsyncSize, item.cacheGroup.maxAsyncSize, Math.min)
|
|
966
|
+
: item.cacheGroup.maxAsyncSize,
|
|
967
|
+
maxInitialSize: oldMaxSizeSettings
|
|
968
|
+
? combineSizes(oldMaxSizeSettings.maxInitialSize, item.cacheGroup.maxInitialSize, Math.min)
|
|
969
|
+
: item.cacheGroup.maxInitialSize,
|
|
970
|
+
automaticNameDelimiter: item.cacheGroup.automaticNameDelimiter,
|
|
971
|
+
keys: oldMaxSizeSettings
|
|
972
|
+
? oldMaxSizeSettings.keys.concat(item.cacheGroup.key)
|
|
973
|
+
: [item.cacheGroup.key],
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
// remove all modules from other entries and update size
|
|
977
|
+
for (const [key, info] of chunksInfoMap) {
|
|
978
|
+
if (isOverlap(info.chunks, usedChunks)) {
|
|
979
|
+
// update modules and total size
|
|
980
|
+
// may remove it from the map when < minSize
|
|
981
|
+
let updated = false;
|
|
982
|
+
for (const module of item.modules) {
|
|
983
|
+
if (info.modules.has(module)) {
|
|
984
|
+
// remove module
|
|
985
|
+
info.modules.delete(module);
|
|
986
|
+
// update size
|
|
987
|
+
for (const key of module.getSourceTypes()) {
|
|
988
|
+
info.sizes[key] -= module.size(key);
|
|
989
|
+
}
|
|
990
|
+
updated = true;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
if (updated) {
|
|
994
|
+
if (info.modules.size === 0) {
|
|
995
|
+
chunksInfoMap.delete(key);
|
|
996
|
+
continue;
|
|
997
|
+
}
|
|
998
|
+
if (removeMinSizeViolatingModules(info) ||
|
|
999
|
+
!checkMinSizeReduction(info.sizes, info.cacheGroup.minSizeReduction, info.chunks.size)) {
|
|
1000
|
+
chunksInfoMap.delete(key);
|
|
1001
|
+
continue;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
logger.timeEnd('queue');
|
|
1008
|
+
logger.time('maxSize');
|
|
1009
|
+
const incorrectMinMaxSizeSet = new Set();
|
|
1010
|
+
const { outputOptions } = compilation;
|
|
1011
|
+
// Make sure that maxSize is fulfilled
|
|
1012
|
+
const { fallbackCacheGroup } = this.options;
|
|
1013
|
+
const allChunks = Array.from(compilation.chunks);
|
|
1014
|
+
for (const chunk of allChunks) {
|
|
1015
|
+
const chunkConfig = maxSizeQueueMap.get(chunk);
|
|
1016
|
+
const { minSize, maxAsyncSize, maxInitialSize, automaticNameDelimiter } = chunkConfig || fallbackCacheGroup;
|
|
1017
|
+
if (!chunkConfig && !fallbackCacheGroup.chunksFilter(chunk))
|
|
1018
|
+
continue;
|
|
1019
|
+
let maxSize;
|
|
1020
|
+
if (chunk.isOnlyInitial()) {
|
|
1021
|
+
maxSize = maxInitialSize;
|
|
1022
|
+
}
|
|
1023
|
+
else if (chunk.canBeInitial()) {
|
|
1024
|
+
maxSize = combineSizes(maxAsyncSize, maxInitialSize, Math.min);
|
|
1025
|
+
}
|
|
1026
|
+
else {
|
|
1027
|
+
maxSize = maxAsyncSize;
|
|
1028
|
+
}
|
|
1029
|
+
if (Object.keys(maxSize).length === 0) {
|
|
1030
|
+
continue;
|
|
1031
|
+
}
|
|
1032
|
+
for (const key of Object.keys(maxSize)) {
|
|
1033
|
+
const maxSizeValue = maxSize[key];
|
|
1034
|
+
const minSizeValue = minSize[key];
|
|
1035
|
+
if (typeof minSizeValue === 'number' && minSizeValue > maxSizeValue) {
|
|
1036
|
+
const keys = chunkConfig === null || chunkConfig === void 0 ? void 0 : chunkConfig.keys;
|
|
1037
|
+
const warningKey = `${keys === null || keys === void 0 ? void 0 : keys.join()} ${minSizeValue} ${maxSizeValue}`;
|
|
1038
|
+
if (!incorrectMinMaxSizeSet.has(warningKey)) {
|
|
1039
|
+
incorrectMinMaxSizeSet.add(warningKey);
|
|
1040
|
+
compilation.warnings.push(new MinMaxSizeWarning_1.default(keys, minSizeValue, maxSizeValue));
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
const results = deterministicGroupingForModules({
|
|
1045
|
+
minSize,
|
|
1046
|
+
maxSize: mapObject(maxSize, (value, key) => {
|
|
1047
|
+
const minSizeValue = minSize[key];
|
|
1048
|
+
return typeof minSizeValue === 'number' ? Math.max(value, minSizeValue) : value;
|
|
1049
|
+
}),
|
|
1050
|
+
items: chunkGraph.getChunkModulesIterable(chunk),
|
|
1051
|
+
getKey(module) {
|
|
1052
|
+
var _a;
|
|
1053
|
+
const cache = getKeyCache.get(module);
|
|
1054
|
+
if (cache !== undefined)
|
|
1055
|
+
return cache;
|
|
1056
|
+
const ident = cachedMakePathsRelative(module.identifier());
|
|
1057
|
+
const nameForCondition = (_a = module.nameForCondition) === null || _a === void 0 ? void 0 : _a.call(module);
|
|
1058
|
+
const name = nameForCondition
|
|
1059
|
+
? cachedMakePathsRelative(nameForCondition)
|
|
1060
|
+
: ident.replace(/^.*!|\?[^?!]*$/g, '');
|
|
1061
|
+
const fullKey = name + automaticNameDelimiter + hashFilename(ident, outputOptions);
|
|
1062
|
+
const key = (0, IdHelpers_1.requestToId)(fullKey);
|
|
1063
|
+
getKeyCache.set(module, key);
|
|
1064
|
+
return key;
|
|
1065
|
+
},
|
|
1066
|
+
getSize(module) {
|
|
1067
|
+
const size = Object.create(null);
|
|
1068
|
+
for (const key of module.getSourceTypes()) {
|
|
1069
|
+
size[key] = module.size(key);
|
|
1070
|
+
}
|
|
1071
|
+
return size;
|
|
1072
|
+
},
|
|
1073
|
+
});
|
|
1074
|
+
if (results.length <= 1) {
|
|
1075
|
+
continue;
|
|
1076
|
+
}
|
|
1077
|
+
for (let i = 0; i < results.length; i++) {
|
|
1078
|
+
const group = results[i];
|
|
1079
|
+
const key = this.options.hidePathInfo
|
|
1080
|
+
? hashFilename(group.key, outputOptions)
|
|
1081
|
+
: group.key;
|
|
1082
|
+
let name = chunk.name ? chunk.name + automaticNameDelimiter + key : null;
|
|
1083
|
+
if (name && name.length > 100) {
|
|
1084
|
+
name =
|
|
1085
|
+
name.slice(0, 100) + automaticNameDelimiter + hashFilename(name, outputOptions);
|
|
1086
|
+
}
|
|
1087
|
+
if (i !== results.length - 1) {
|
|
1088
|
+
const newPart = compilation.addChunk(name);
|
|
1089
|
+
chunk.split(newPart);
|
|
1090
|
+
newPart.chunkReason = chunk.chunkReason;
|
|
1091
|
+
// Add all modules to the new chunk
|
|
1092
|
+
for (const module of group.items) {
|
|
1093
|
+
if (!module.chunkCondition(newPart, compilation)) {
|
|
1094
|
+
continue;
|
|
1095
|
+
}
|
|
1096
|
+
// Add module to new chunk
|
|
1097
|
+
chunkGraph.connectChunkAndModule(newPart, module);
|
|
1098
|
+
// Remove module from used chunks
|
|
1099
|
+
chunkGraph.disconnectChunkAndModule(chunk, module);
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
else {
|
|
1103
|
+
// change the chunk to be a part
|
|
1104
|
+
chunk.name = name;
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
logger.timeEnd('maxSize');
|
|
1109
|
+
});
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
exports.default = SplitChunksPlugin;
|