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,1067 @@
|
|
|
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 AsyncDependencyToInitialChunkError_1 = __importDefault(require("@/base/errors/AsyncDependencyToInitialChunkError"));
|
|
7
|
+
const ModuleGraphConnection_1 = require("@/module/ModuleGraphConnection");
|
|
8
|
+
const RuntimeHelpers_1 = require("@/module/RuntimeHelpers");
|
|
9
|
+
const GraphHelpers_1 = require("./GraphHelpers");
|
|
10
|
+
const EMPTY_SET = new Set();
|
|
11
|
+
EMPTY_SET.plus = EMPTY_SET;
|
|
12
|
+
const bySetSize = (a, b) => b.size + b.plus.size - a.size - a.plus.size;
|
|
13
|
+
const extractBlockModules = (module, moduleGraph, runtime, blockModulesMap) => {
|
|
14
|
+
let blockCache;
|
|
15
|
+
let modules;
|
|
16
|
+
const arrays = [];
|
|
17
|
+
const queue = [module];
|
|
18
|
+
while (queue.length > 0) {
|
|
19
|
+
const block = queue.pop();
|
|
20
|
+
const arr = [];
|
|
21
|
+
arrays.push(arr);
|
|
22
|
+
blockModulesMap.set(block, arr);
|
|
23
|
+
for (const b of block.blocks) {
|
|
24
|
+
queue.push(b);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
for (const connection of moduleGraph.getOutgoingConnections(module)) {
|
|
28
|
+
const d = connection.dependency;
|
|
29
|
+
// We skip connections without dependency
|
|
30
|
+
if (!d)
|
|
31
|
+
continue;
|
|
32
|
+
const m = connection.module;
|
|
33
|
+
// We skip connections without Module pointer
|
|
34
|
+
if (!m)
|
|
35
|
+
continue;
|
|
36
|
+
// We skip weak connections
|
|
37
|
+
if (connection.weak)
|
|
38
|
+
continue;
|
|
39
|
+
const state = connection.getActiveState(runtime);
|
|
40
|
+
// We skip inactive connections
|
|
41
|
+
if (state === false)
|
|
42
|
+
continue;
|
|
43
|
+
const block = moduleGraph.getParentBlock(d);
|
|
44
|
+
let index = moduleGraph.getParentBlockIndex(d);
|
|
45
|
+
// deprecated fallback
|
|
46
|
+
if (index < 0) {
|
|
47
|
+
index = block.dependencies.indexOf(d);
|
|
48
|
+
}
|
|
49
|
+
if (blockCache !== block) {
|
|
50
|
+
modules = blockModulesMap.get((blockCache = block));
|
|
51
|
+
}
|
|
52
|
+
const i = index << 2;
|
|
53
|
+
modules[i] = m;
|
|
54
|
+
modules[i + 1] = state;
|
|
55
|
+
}
|
|
56
|
+
for (const modules of arrays) {
|
|
57
|
+
if (modules.length === 0)
|
|
58
|
+
continue;
|
|
59
|
+
let indexMap;
|
|
60
|
+
let length = 0;
|
|
61
|
+
outer: for (let j = 0; j < modules.length; j += 2) {
|
|
62
|
+
const m = modules[j];
|
|
63
|
+
if (m === undefined)
|
|
64
|
+
continue;
|
|
65
|
+
const state = modules[j + 1];
|
|
66
|
+
if (indexMap === undefined) {
|
|
67
|
+
let i = 0;
|
|
68
|
+
for (; i < length; i += 2) {
|
|
69
|
+
if (modules[i] === m) {
|
|
70
|
+
const merged = modules[i + 1];
|
|
71
|
+
if (merged === true)
|
|
72
|
+
continue outer;
|
|
73
|
+
modules[i + 1] = (0, ModuleGraphConnection_1.addConnectionStates)(merged, state);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
modules[length] = m;
|
|
77
|
+
length++;
|
|
78
|
+
modules[length] = state;
|
|
79
|
+
length++;
|
|
80
|
+
if (length > 30) {
|
|
81
|
+
// To avoid worse case performance, we will use an index map for
|
|
82
|
+
// linear cost access, which allows to maintain O(n) complexity
|
|
83
|
+
// while keeping allocations down to a minimum
|
|
84
|
+
indexMap = new Map();
|
|
85
|
+
for (let i = 0; i < length; i += 2) {
|
|
86
|
+
indexMap.set(modules[i], i + 1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const idx = indexMap.get(m);
|
|
92
|
+
if (idx !== undefined) {
|
|
93
|
+
const merged = modules[idx];
|
|
94
|
+
if (merged === true)
|
|
95
|
+
continue;
|
|
96
|
+
modules[idx] = (0, ModuleGraphConnection_1.addConnectionStates)(merged, state);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
modules[length] = m;
|
|
100
|
+
length++;
|
|
101
|
+
modules[length] = state;
|
|
102
|
+
indexMap.set(m, length);
|
|
103
|
+
length++;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
modules.length = length;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const visitModules = (logger, compilation, inputEntrypointsAndModules, chunkGroupInfoMap, blockConnections, blocksWithNestedBlocks, allCreatedChunkGroups) => {
|
|
111
|
+
const { moduleGraph, chunkGraph, moduleMemCaches } = compilation;
|
|
112
|
+
const blockModulesRuntimeMap = new Map();
|
|
113
|
+
const blockModulesMapRuntime = false;
|
|
114
|
+
let blockModulesMap;
|
|
115
|
+
const getBlockModules = (block, runtime) => {
|
|
116
|
+
if (blockModulesMapRuntime !== runtime) {
|
|
117
|
+
blockModulesMap = blockModulesRuntimeMap.get(runtime);
|
|
118
|
+
if (blockModulesMap === undefined) {
|
|
119
|
+
blockModulesMap = new Map();
|
|
120
|
+
blockModulesRuntimeMap.set(runtime, blockModulesMap);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
let blockModules = blockModulesMap.get(block);
|
|
124
|
+
if (blockModules !== undefined)
|
|
125
|
+
return blockModules;
|
|
126
|
+
const module = block.getRootBlock();
|
|
127
|
+
const memCache = moduleMemCaches === null || moduleMemCaches === void 0 ? void 0 : moduleMemCaches.get(module);
|
|
128
|
+
if (memCache !== undefined) {
|
|
129
|
+
const map = memCache.provide('bundleChunkGraph.blockModules', runtime, () => {
|
|
130
|
+
logger.time('visitModules: prepare');
|
|
131
|
+
const map = new Map();
|
|
132
|
+
extractBlockModules(module, moduleGraph, runtime, map);
|
|
133
|
+
logger.timeAggregate('visitModules: prepare');
|
|
134
|
+
return map;
|
|
135
|
+
});
|
|
136
|
+
for (const [block, blockModules] of map)
|
|
137
|
+
blockModulesMap.set(block, blockModules);
|
|
138
|
+
return map.get(block);
|
|
139
|
+
}
|
|
140
|
+
logger.time('visitModules: prepare');
|
|
141
|
+
extractBlockModules(module, moduleGraph, runtime, blockModulesMap);
|
|
142
|
+
blockModules = blockModulesMap.get(block);
|
|
143
|
+
logger.timeAggregate('visitModules: prepare');
|
|
144
|
+
return blockModules;
|
|
145
|
+
};
|
|
146
|
+
let statProcessedQueueItems = 0;
|
|
147
|
+
let statProcessedBlocks = 0;
|
|
148
|
+
let statConnectedChunkGroups = 0;
|
|
149
|
+
let statProcessedChunkGroupsForMerging = 0;
|
|
150
|
+
let statMergedAvailableModuleSets = 0;
|
|
151
|
+
let statForkedAvailableModules = 0;
|
|
152
|
+
let statForkedAvailableModulesCount = 0;
|
|
153
|
+
let statForkedAvailableModulesCountPlus = 0;
|
|
154
|
+
let statForkedMergedModulesCount = 0;
|
|
155
|
+
let statForkedMergedModulesCountPlus = 0;
|
|
156
|
+
let statForkedResultModulesCount = 0;
|
|
157
|
+
let statChunkGroupInfoUpdated = 0;
|
|
158
|
+
let statChildChunkGroupsReconnected = 0;
|
|
159
|
+
let nextChunkGroupIndex = 0;
|
|
160
|
+
let nextFreeModulePreOrderIndex = 0;
|
|
161
|
+
let nextFreeModulePostOrderIndex = 0;
|
|
162
|
+
const blockChunkGroups = new Map();
|
|
163
|
+
const namedChunkGroups = new Map();
|
|
164
|
+
const namedAsyncEntrypoints = new Map();
|
|
165
|
+
const ADD_AND_ENTER_ENTRY_MODULE = 0;
|
|
166
|
+
const ADD_AND_ENTER_MODULE = 1;
|
|
167
|
+
const ENTER_MODULE = 2;
|
|
168
|
+
const PROCESS_BLOCK = 3;
|
|
169
|
+
const PROCESS_ENTRY_BLOCK = 4;
|
|
170
|
+
const LEAVE_MODULE = 5;
|
|
171
|
+
let queue = [];
|
|
172
|
+
const queueConnect = new Map();
|
|
173
|
+
const chunkGroupsForCombining = new Set();
|
|
174
|
+
// Fill queue with entrypoint modules
|
|
175
|
+
// Create ChunkGroupInfo for entrypoints
|
|
176
|
+
for (const [chunkGroup, modules] of inputEntrypointsAndModules) {
|
|
177
|
+
const runtime = (0, RuntimeHelpers_1.getEntryRuntime)(compilation, chunkGroup.name, chunkGroup.options);
|
|
178
|
+
const chunkGroupInfo = {
|
|
179
|
+
chunkGroup,
|
|
180
|
+
runtime,
|
|
181
|
+
minAvailableModules: undefined,
|
|
182
|
+
minAvailableModulesOwned: false,
|
|
183
|
+
availableModulesToBeMerged: [],
|
|
184
|
+
skippedItems: undefined,
|
|
185
|
+
resultingAvailableModules: undefined,
|
|
186
|
+
children: undefined,
|
|
187
|
+
availableSources: undefined,
|
|
188
|
+
availableChildren: undefined,
|
|
189
|
+
preOrderIndex: 0,
|
|
190
|
+
postOrderIndex: 0,
|
|
191
|
+
chunkLoading: chunkGroup.options.chunkLoading !== undefined
|
|
192
|
+
? chunkGroup.options.chunkLoading !== false
|
|
193
|
+
: compilation.outputOptions.chunkLoading !== false,
|
|
194
|
+
asyncChunks: chunkGroup.options.asyncChunks !== undefined
|
|
195
|
+
? chunkGroup.options.asyncChunks
|
|
196
|
+
: compilation.outputOptions.asyncChunks !== false,
|
|
197
|
+
};
|
|
198
|
+
chunkGroup.index = nextChunkGroupIndex++;
|
|
199
|
+
if (chunkGroup.getNumberOfParents() > 0) {
|
|
200
|
+
// minAvailableModules for child entrypoints are unknown yet, set to undefined.
|
|
201
|
+
// This means no module is added until other sets are merged into
|
|
202
|
+
// this minAvailableModules (by the parent entrypoints)
|
|
203
|
+
const skippedItems = new Set();
|
|
204
|
+
for (const module of modules) {
|
|
205
|
+
skippedItems.add(module);
|
|
206
|
+
}
|
|
207
|
+
chunkGroupInfo.skippedItems = skippedItems;
|
|
208
|
+
chunkGroupsForCombining.add(chunkGroupInfo);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
// The application may start here: We start with an empty list of available modules
|
|
212
|
+
chunkGroupInfo.minAvailableModules = EMPTY_SET;
|
|
213
|
+
const chunk = chunkGroup.getEntrypointChunk();
|
|
214
|
+
for (const module of modules) {
|
|
215
|
+
queue.push({
|
|
216
|
+
action: ADD_AND_ENTER_MODULE,
|
|
217
|
+
block: module,
|
|
218
|
+
module,
|
|
219
|
+
chunk,
|
|
220
|
+
chunkGroup,
|
|
221
|
+
chunkGroupInfo,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
chunkGroupInfoMap.set(chunkGroup, chunkGroupInfo);
|
|
226
|
+
if (chunkGroup.name) {
|
|
227
|
+
namedChunkGroups.set(chunkGroup.name, chunkGroupInfo);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// Fill availableSources with parent-child dependencies between entrypoints
|
|
231
|
+
for (const chunkGroupInfo of chunkGroupsForCombining) {
|
|
232
|
+
const { chunkGroup } = chunkGroupInfo;
|
|
233
|
+
chunkGroupInfo.availableSources = new Set();
|
|
234
|
+
for (const parent of chunkGroup.parentsIterable) {
|
|
235
|
+
const parentChunkGroupInfo = chunkGroupInfoMap.get(parent);
|
|
236
|
+
chunkGroupInfo.availableSources.add(parentChunkGroupInfo);
|
|
237
|
+
if (parentChunkGroupInfo.availableChildren === undefined) {
|
|
238
|
+
parentChunkGroupInfo.availableChildren = new Set();
|
|
239
|
+
}
|
|
240
|
+
parentChunkGroupInfo.availableChildren.add(chunkGroupInfo);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
// pop() is used to read from the queue
|
|
244
|
+
// so it need to be reversed to be iterated in
|
|
245
|
+
// correct order
|
|
246
|
+
queue.reverse();
|
|
247
|
+
const outdatedChunkGroupInfo = new Set();
|
|
248
|
+
const chunkGroupsForMerging = new Set();
|
|
249
|
+
let queueDelayed = [];
|
|
250
|
+
const skipConnectionBuffer = [];
|
|
251
|
+
const skipBuffer = [];
|
|
252
|
+
const queueBuffer = [];
|
|
253
|
+
let module;
|
|
254
|
+
let chunk;
|
|
255
|
+
let chunkGroup;
|
|
256
|
+
let block;
|
|
257
|
+
let chunkGroupInfo;
|
|
258
|
+
// For each async Block in graph
|
|
259
|
+
const iteratorBlock = b => {
|
|
260
|
+
var _a, _b;
|
|
261
|
+
// 1. We create a chunk group with single chunk in it for this Block
|
|
262
|
+
// but only once (blockChunkGroups map)
|
|
263
|
+
let cgi = blockChunkGroups.get(b);
|
|
264
|
+
let c;
|
|
265
|
+
let entrypoint;
|
|
266
|
+
const entryOptions = (_a = b.groupOptions) === null || _a === void 0 ? void 0 : _a.entryOptions;
|
|
267
|
+
if (cgi === undefined) {
|
|
268
|
+
const chunkName = ((_b = b.groupOptions) === null || _b === void 0 ? void 0 : _b.name) || b.chunkName;
|
|
269
|
+
if (entryOptions) {
|
|
270
|
+
cgi = namedAsyncEntrypoints.get(chunkName);
|
|
271
|
+
if (!cgi) {
|
|
272
|
+
entrypoint = compilation.addAsyncEntrypoint(entryOptions, module, b.loc, b.request);
|
|
273
|
+
entrypoint.index = nextChunkGroupIndex++;
|
|
274
|
+
cgi = {
|
|
275
|
+
chunkGroup: entrypoint,
|
|
276
|
+
runtime: entrypoint.options.runtime || entrypoint.name,
|
|
277
|
+
minAvailableModules: EMPTY_SET,
|
|
278
|
+
minAvailableModulesOwned: false,
|
|
279
|
+
availableModulesToBeMerged: [],
|
|
280
|
+
skippedItems: undefined,
|
|
281
|
+
resultingAvailableModules: undefined,
|
|
282
|
+
children: undefined,
|
|
283
|
+
availableSources: undefined,
|
|
284
|
+
availableChildren: undefined,
|
|
285
|
+
preOrderIndex: 0,
|
|
286
|
+
postOrderIndex: 0,
|
|
287
|
+
chunkLoading: entryOptions.chunkLoading !== undefined
|
|
288
|
+
? entryOptions.chunkLoading !== false
|
|
289
|
+
: chunkGroupInfo.chunkLoading,
|
|
290
|
+
asyncChunks: entryOptions.asyncChunks !== undefined
|
|
291
|
+
? entryOptions.asyncChunks
|
|
292
|
+
: chunkGroupInfo.asyncChunks,
|
|
293
|
+
};
|
|
294
|
+
chunkGroupInfoMap.set(entrypoint, cgi);
|
|
295
|
+
chunkGraph.connectBlockAndChunkGroup(b, entrypoint);
|
|
296
|
+
if (chunkName) {
|
|
297
|
+
namedAsyncEntrypoints.set(chunkName, cgi);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
entrypoint = cgi.chunkGroup;
|
|
302
|
+
// TODO merge entryOptions
|
|
303
|
+
entrypoint.addOrigin(module, b.loc, b.request);
|
|
304
|
+
chunkGraph.connectBlockAndChunkGroup(b, entrypoint);
|
|
305
|
+
}
|
|
306
|
+
// 2. We enqueue the DependenciesBlock for traversal
|
|
307
|
+
queueDelayed.push({
|
|
308
|
+
action: PROCESS_ENTRY_BLOCK,
|
|
309
|
+
block: b,
|
|
310
|
+
module,
|
|
311
|
+
chunk: entrypoint.chunks[0],
|
|
312
|
+
chunkGroup: entrypoint,
|
|
313
|
+
chunkGroupInfo: cgi,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
else if (!chunkGroupInfo.asyncChunks || !chunkGroupInfo.chunkLoading) {
|
|
317
|
+
// Just queue the block into the current chunk group
|
|
318
|
+
queue.push({
|
|
319
|
+
action: PROCESS_BLOCK,
|
|
320
|
+
block: b,
|
|
321
|
+
module,
|
|
322
|
+
chunk,
|
|
323
|
+
chunkGroup,
|
|
324
|
+
chunkGroupInfo,
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
cgi = chunkName && namedChunkGroups.get(chunkName);
|
|
329
|
+
if (!cgi) {
|
|
330
|
+
c = compilation.addChunkInGroup(b.groupOptions || b.chunkName, module, b.loc, b.request);
|
|
331
|
+
c.index = nextChunkGroupIndex++;
|
|
332
|
+
cgi = {
|
|
333
|
+
chunkGroup: c,
|
|
334
|
+
runtime: chunkGroupInfo.runtime,
|
|
335
|
+
minAvailableModules: undefined,
|
|
336
|
+
minAvailableModulesOwned: undefined,
|
|
337
|
+
availableModulesToBeMerged: [],
|
|
338
|
+
skippedItems: undefined,
|
|
339
|
+
resultingAvailableModules: undefined,
|
|
340
|
+
children: undefined,
|
|
341
|
+
availableSources: undefined,
|
|
342
|
+
availableChildren: undefined,
|
|
343
|
+
preOrderIndex: 0,
|
|
344
|
+
postOrderIndex: 0,
|
|
345
|
+
chunkLoading: chunkGroupInfo.chunkLoading,
|
|
346
|
+
asyncChunks: chunkGroupInfo.asyncChunks,
|
|
347
|
+
};
|
|
348
|
+
allCreatedChunkGroups.add(c);
|
|
349
|
+
chunkGroupInfoMap.set(c, cgi);
|
|
350
|
+
if (chunkName) {
|
|
351
|
+
namedChunkGroups.set(chunkName, cgi);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
c = cgi.chunkGroup;
|
|
356
|
+
if (c.isInitial()) {
|
|
357
|
+
compilation.errors.push(new AsyncDependencyToInitialChunkError_1.default(chunkName, module, b.loc));
|
|
358
|
+
c = chunkGroup;
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
c.addOptions(b.groupOptions);
|
|
362
|
+
}
|
|
363
|
+
c.addOrigin(module, b.loc, b.request);
|
|
364
|
+
}
|
|
365
|
+
blockConnections.set(b, []);
|
|
366
|
+
}
|
|
367
|
+
blockChunkGroups.set(b, cgi);
|
|
368
|
+
}
|
|
369
|
+
else if (entryOptions) {
|
|
370
|
+
entrypoint = cgi.chunkGroup;
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
c = cgi.chunkGroup;
|
|
374
|
+
}
|
|
375
|
+
if (c !== undefined) {
|
|
376
|
+
// 2. We store the connection for the block
|
|
377
|
+
// to connect it later if needed
|
|
378
|
+
blockConnections.get(b).push({
|
|
379
|
+
originChunkGroupInfo: chunkGroupInfo,
|
|
380
|
+
chunkGroup: c,
|
|
381
|
+
});
|
|
382
|
+
// 3. We enqueue the chunk group info creation/updating
|
|
383
|
+
let connectList = queueConnect.get(chunkGroupInfo);
|
|
384
|
+
if (connectList === undefined) {
|
|
385
|
+
connectList = new Set();
|
|
386
|
+
queueConnect.set(chunkGroupInfo, connectList);
|
|
387
|
+
}
|
|
388
|
+
connectList.add(cgi);
|
|
389
|
+
// TODO check if this really need to be done for each traversal
|
|
390
|
+
// or if it is enough when it's queued when created
|
|
391
|
+
// 4. We enqueue the DependenciesBlock for traversal
|
|
392
|
+
queueDelayed.push({
|
|
393
|
+
action: PROCESS_BLOCK,
|
|
394
|
+
block: b,
|
|
395
|
+
module,
|
|
396
|
+
chunk: c.chunks[0],
|
|
397
|
+
chunkGroup: c,
|
|
398
|
+
chunkGroupInfo: cgi,
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
else if (entrypoint !== undefined) {
|
|
402
|
+
chunkGroupInfo.chunkGroup.addAsyncEntrypoint(entrypoint);
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
const processBlock = block => {
|
|
406
|
+
statProcessedBlocks++;
|
|
407
|
+
// get prepared block info
|
|
408
|
+
const blockModules = getBlockModules(block, chunkGroupInfo.runtime);
|
|
409
|
+
if (blockModules !== undefined) {
|
|
410
|
+
const { minAvailableModules } = chunkGroupInfo;
|
|
411
|
+
// Buffer items because order need to be reversed to get indices correct
|
|
412
|
+
// Traverse all referenced modules
|
|
413
|
+
for (let i = 0; i < blockModules.length; i += 2) {
|
|
414
|
+
const refModule = blockModules[i];
|
|
415
|
+
if (chunkGraph.isModuleInChunk(refModule, chunk)) {
|
|
416
|
+
// skip early if already connected
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
const activeState = blockModules[i + 1];
|
|
420
|
+
if (activeState !== true) {
|
|
421
|
+
skipConnectionBuffer.push([refModule, activeState]);
|
|
422
|
+
if (activeState === false)
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
if (activeState === true &&
|
|
426
|
+
(minAvailableModules.has(refModule) || minAvailableModules.plus.has(refModule))) {
|
|
427
|
+
// already in parent chunks, skip it for now
|
|
428
|
+
skipBuffer.push(refModule);
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
431
|
+
// enqueue, then add and enter to be in the correct order
|
|
432
|
+
// this is relevant with circular dependencies
|
|
433
|
+
queueBuffer.push({
|
|
434
|
+
action: activeState === true ? ADD_AND_ENTER_MODULE : PROCESS_BLOCK,
|
|
435
|
+
block: refModule,
|
|
436
|
+
module: refModule,
|
|
437
|
+
chunk,
|
|
438
|
+
chunkGroup,
|
|
439
|
+
chunkGroupInfo,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
// Add buffered items in reverse order
|
|
443
|
+
if (skipConnectionBuffer.length > 0) {
|
|
444
|
+
let { skippedModuleConnections } = chunkGroupInfo;
|
|
445
|
+
if (skippedModuleConnections === undefined) {
|
|
446
|
+
chunkGroupInfo.skippedModuleConnections = skippedModuleConnections = new Set();
|
|
447
|
+
}
|
|
448
|
+
for (let i = skipConnectionBuffer.length - 1; i >= 0; i--) {
|
|
449
|
+
skippedModuleConnections.add(skipConnectionBuffer[i]);
|
|
450
|
+
}
|
|
451
|
+
skipConnectionBuffer.length = 0;
|
|
452
|
+
}
|
|
453
|
+
if (skipBuffer.length > 0) {
|
|
454
|
+
let { skippedItems } = chunkGroupInfo;
|
|
455
|
+
if (skippedItems === undefined) {
|
|
456
|
+
chunkGroupInfo.skippedItems = skippedItems = new Set();
|
|
457
|
+
}
|
|
458
|
+
for (let i = skipBuffer.length - 1; i >= 0; i--) {
|
|
459
|
+
skippedItems.add(skipBuffer[i]);
|
|
460
|
+
}
|
|
461
|
+
skipBuffer.length = 0;
|
|
462
|
+
}
|
|
463
|
+
if (queueBuffer.length > 0) {
|
|
464
|
+
for (let i = queueBuffer.length - 1; i >= 0; i--) {
|
|
465
|
+
queue.push(queueBuffer[i]);
|
|
466
|
+
}
|
|
467
|
+
queueBuffer.length = 0;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
// Traverse all Blocks
|
|
471
|
+
for (const b of block.blocks) {
|
|
472
|
+
iteratorBlock(b);
|
|
473
|
+
}
|
|
474
|
+
if (block.blocks.length > 0 && module !== block) {
|
|
475
|
+
blocksWithNestedBlocks.add(block);
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
const processEntryBlock = block => {
|
|
479
|
+
statProcessedBlocks++;
|
|
480
|
+
// get prepared block info
|
|
481
|
+
const blockModules = getBlockModules(block, chunkGroupInfo.runtime);
|
|
482
|
+
if (blockModules !== undefined) {
|
|
483
|
+
// Traverse all referenced modules
|
|
484
|
+
for (let i = 0; i < blockModules.length; i += 2) {
|
|
485
|
+
const refModule = blockModules[i];
|
|
486
|
+
const activeState = blockModules[i + 1];
|
|
487
|
+
// enqueue, then add and enter to be in the correct order
|
|
488
|
+
// this is relevant with circular dependencies
|
|
489
|
+
queueBuffer.push({
|
|
490
|
+
action: activeState === true ? ADD_AND_ENTER_ENTRY_MODULE : PROCESS_BLOCK,
|
|
491
|
+
block: refModule,
|
|
492
|
+
module: refModule,
|
|
493
|
+
chunk,
|
|
494
|
+
chunkGroup,
|
|
495
|
+
chunkGroupInfo,
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
// Add buffered items in reverse order
|
|
499
|
+
if (queueBuffer.length > 0) {
|
|
500
|
+
for (let i = queueBuffer.length - 1; i >= 0; i--) {
|
|
501
|
+
queue.push(queueBuffer[i]);
|
|
502
|
+
}
|
|
503
|
+
queueBuffer.length = 0;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
// Traverse all Blocks
|
|
507
|
+
for (const b of block.blocks) {
|
|
508
|
+
iteratorBlock(b);
|
|
509
|
+
}
|
|
510
|
+
if (block.blocks.length > 0 && module !== block) {
|
|
511
|
+
blocksWithNestedBlocks.add(block);
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
const processQueue = () => {
|
|
515
|
+
while (queue.length) {
|
|
516
|
+
statProcessedQueueItems++;
|
|
517
|
+
const queueItem = queue.pop();
|
|
518
|
+
module = queueItem.module;
|
|
519
|
+
block = queueItem.block;
|
|
520
|
+
chunk = queueItem.chunk;
|
|
521
|
+
chunkGroup = queueItem.chunkGroup;
|
|
522
|
+
chunkGroupInfo = queueItem.chunkGroupInfo;
|
|
523
|
+
switch (queueItem.action) {
|
|
524
|
+
case ADD_AND_ENTER_ENTRY_MODULE:
|
|
525
|
+
chunkGraph.connectChunkAndEntryModule(chunk, module, chunkGroup);
|
|
526
|
+
// fallthrough
|
|
527
|
+
case ADD_AND_ENTER_MODULE: {
|
|
528
|
+
if (chunkGraph.isModuleInChunk(module, chunk)) {
|
|
529
|
+
// already connected, skip it
|
|
530
|
+
break;
|
|
531
|
+
}
|
|
532
|
+
// We connect Module and Chunk
|
|
533
|
+
chunkGraph.connectChunkAndModule(chunk, module);
|
|
534
|
+
}
|
|
535
|
+
// fallthrough
|
|
536
|
+
case ENTER_MODULE: {
|
|
537
|
+
const index = chunkGroup.getModulePreOrderIndex(module);
|
|
538
|
+
if (index === undefined) {
|
|
539
|
+
chunkGroup.setModulePreOrderIndex(module, chunkGroupInfo.preOrderIndex++);
|
|
540
|
+
}
|
|
541
|
+
if (moduleGraph.setPreOrderIndexIfUnset(module, nextFreeModulePreOrderIndex)) {
|
|
542
|
+
nextFreeModulePreOrderIndex++;
|
|
543
|
+
}
|
|
544
|
+
// reuse queueItem
|
|
545
|
+
queueItem.action = LEAVE_MODULE;
|
|
546
|
+
queue.push(queueItem);
|
|
547
|
+
}
|
|
548
|
+
// fallthrough
|
|
549
|
+
case PROCESS_BLOCK: {
|
|
550
|
+
processBlock(block);
|
|
551
|
+
break;
|
|
552
|
+
}
|
|
553
|
+
case PROCESS_ENTRY_BLOCK: {
|
|
554
|
+
processEntryBlock(block);
|
|
555
|
+
break;
|
|
556
|
+
}
|
|
557
|
+
case LEAVE_MODULE: {
|
|
558
|
+
const index = chunkGroup.getModulePostOrderIndex(module);
|
|
559
|
+
if (index === undefined) {
|
|
560
|
+
chunkGroup.setModulePostOrderIndex(module, chunkGroupInfo.postOrderIndex++);
|
|
561
|
+
}
|
|
562
|
+
if (moduleGraph.setPostOrderIndexIfUnset(module, nextFreeModulePostOrderIndex)) {
|
|
563
|
+
nextFreeModulePostOrderIndex++;
|
|
564
|
+
}
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
const calculateResultingAvailableModules = chunkGroupInfo => {
|
|
571
|
+
if (chunkGroupInfo.resultingAvailableModules)
|
|
572
|
+
return chunkGroupInfo.resultingAvailableModules;
|
|
573
|
+
const minAvailableModules = chunkGroupInfo.minAvailableModules;
|
|
574
|
+
// Create a new Set of available modules at this point
|
|
575
|
+
// We want to be as lazy as possible. There are multiple ways doing this:
|
|
576
|
+
// Note that resultingAvailableModules is stored as "(a) + (b)" as it's a ModuleSetPlus
|
|
577
|
+
// - resultingAvailableModules = (modules of chunk) + (minAvailableModules + minAvailableModules.plus)
|
|
578
|
+
// - resultingAvailableModules = (minAvailableModules + modules of chunk) + (minAvailableModules.plus)
|
|
579
|
+
// We choose one depending on the size of minAvailableModules vs minAvailableModules.plus
|
|
580
|
+
let resultingAvailableModules;
|
|
581
|
+
if (minAvailableModules.size > minAvailableModules.plus.size) {
|
|
582
|
+
// resultingAvailableModules = (modules of chunk) + (minAvailableModules + minAvailableModules.plus)
|
|
583
|
+
resultingAvailableModules = new Set();
|
|
584
|
+
for (const module of minAvailableModules.plus)
|
|
585
|
+
minAvailableModules.add(module);
|
|
586
|
+
minAvailableModules.plus = EMPTY_SET;
|
|
587
|
+
resultingAvailableModules.plus = minAvailableModules;
|
|
588
|
+
chunkGroupInfo.minAvailableModulesOwned = false;
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
// resultingAvailableModules = (minAvailableModules + modules of chunk) + (minAvailableModules.plus)
|
|
592
|
+
resultingAvailableModules = new Set(minAvailableModules);
|
|
593
|
+
resultingAvailableModules.plus = minAvailableModules.plus;
|
|
594
|
+
}
|
|
595
|
+
// add the modules from the chunk group to the set
|
|
596
|
+
for (const chunk of chunkGroupInfo.chunkGroup.chunks) {
|
|
597
|
+
for (const m of chunkGraph.getChunkModulesIterable(chunk)) {
|
|
598
|
+
resultingAvailableModules.add(m);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
chunkGroupInfo.resultingAvailableModules = resultingAvailableModules;
|
|
602
|
+
return chunkGroupInfo.resultingAvailableModules;
|
|
603
|
+
};
|
|
604
|
+
const processConnectQueue = () => {
|
|
605
|
+
// Figure out new parents for chunk groups
|
|
606
|
+
// to get new available modules for these children
|
|
607
|
+
for (const [chunkGroupInfo, targets] of queueConnect) {
|
|
608
|
+
// 1. Add new targets to the list of children
|
|
609
|
+
if (chunkGroupInfo.children === undefined) {
|
|
610
|
+
chunkGroupInfo.children = targets;
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
for (const target of targets) {
|
|
614
|
+
chunkGroupInfo.children.add(target);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
// 2. Calculate resulting available modules
|
|
618
|
+
const resultingAvailableModules = calculateResultingAvailableModules(chunkGroupInfo);
|
|
619
|
+
const runtime = chunkGroupInfo.runtime;
|
|
620
|
+
// 3. Update chunk group info
|
|
621
|
+
for (const target of targets) {
|
|
622
|
+
target.availableModulesToBeMerged.push(resultingAvailableModules);
|
|
623
|
+
chunkGroupsForMerging.add(target);
|
|
624
|
+
const oldRuntime = target.runtime;
|
|
625
|
+
const newRuntime = (0, RuntimeHelpers_1.mergeRuntime)(oldRuntime, runtime);
|
|
626
|
+
if (oldRuntime !== newRuntime) {
|
|
627
|
+
target.runtime = newRuntime;
|
|
628
|
+
outdatedChunkGroupInfo.add(target);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
statConnectedChunkGroups += targets.size;
|
|
632
|
+
}
|
|
633
|
+
queueConnect.clear();
|
|
634
|
+
};
|
|
635
|
+
const processChunkGroupsForMerging = () => {
|
|
636
|
+
statProcessedChunkGroupsForMerging += chunkGroupsForMerging.size;
|
|
637
|
+
// Execute the merge
|
|
638
|
+
for (const info of chunkGroupsForMerging) {
|
|
639
|
+
const availableModulesToBeMerged = info.availableModulesToBeMerged;
|
|
640
|
+
let cachedMinAvailableModules = info.minAvailableModules;
|
|
641
|
+
statMergedAvailableModuleSets += availableModulesToBeMerged.length;
|
|
642
|
+
// 1. Get minimal available modules
|
|
643
|
+
// It doesn't make sense to traverse a chunk again with more available modules.
|
|
644
|
+
// This step calculates the minimal available modules and skips traversal when
|
|
645
|
+
// the list didn't shrink.
|
|
646
|
+
if (availableModulesToBeMerged.length > 1) {
|
|
647
|
+
availableModulesToBeMerged.sort(bySetSize);
|
|
648
|
+
}
|
|
649
|
+
let changed = false;
|
|
650
|
+
merge: for (const availableModules of availableModulesToBeMerged) {
|
|
651
|
+
if (cachedMinAvailableModules === undefined) {
|
|
652
|
+
cachedMinAvailableModules = availableModules;
|
|
653
|
+
info.minAvailableModules = cachedMinAvailableModules;
|
|
654
|
+
info.minAvailableModulesOwned = false;
|
|
655
|
+
changed = true;
|
|
656
|
+
}
|
|
657
|
+
else if (info.minAvailableModulesOwned) {
|
|
658
|
+
// We own it and can modify it
|
|
659
|
+
if (cachedMinAvailableModules.plus === availableModules.plus) {
|
|
660
|
+
for (const m of cachedMinAvailableModules) {
|
|
661
|
+
if (!availableModules.has(m)) {
|
|
662
|
+
cachedMinAvailableModules.delete(m);
|
|
663
|
+
changed = true;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
else {
|
|
668
|
+
for (const m of cachedMinAvailableModules) {
|
|
669
|
+
if (!availableModules.has(m) && !availableModules.plus.has(m)) {
|
|
670
|
+
cachedMinAvailableModules.delete(m);
|
|
671
|
+
changed = true;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
for (const m of cachedMinAvailableModules.plus) {
|
|
675
|
+
if (!availableModules.has(m) && !availableModules.plus.has(m)) {
|
|
676
|
+
// We can't remove modules from the plus part
|
|
677
|
+
// so we need to merge plus into the normal part to allow modifying it
|
|
678
|
+
const iterator = cachedMinAvailableModules.plus[Symbol.iterator]();
|
|
679
|
+
// fast forward add all modules until m
|
|
680
|
+
let it;
|
|
681
|
+
while (!(it = iterator.next()).done) {
|
|
682
|
+
const module = it.value;
|
|
683
|
+
if (module === m)
|
|
684
|
+
break;
|
|
685
|
+
cachedMinAvailableModules.add(module);
|
|
686
|
+
}
|
|
687
|
+
// check the remaining modules before adding
|
|
688
|
+
while (!(it = iterator.next()).done) {
|
|
689
|
+
const module = it.value;
|
|
690
|
+
if (availableModules.has(module) || availableModules.plus.has(module)) {
|
|
691
|
+
cachedMinAvailableModules.add(module);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
cachedMinAvailableModules.plus = EMPTY_SET;
|
|
695
|
+
changed = true;
|
|
696
|
+
continue merge;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
else if (cachedMinAvailableModules.plus === availableModules.plus) {
|
|
702
|
+
// Common and fast case when the plus part is shared
|
|
703
|
+
// We only need to care about the normal part
|
|
704
|
+
if (availableModules.size < cachedMinAvailableModules.size) {
|
|
705
|
+
// the new availableModules is smaller so it's faster to
|
|
706
|
+
// fork from the new availableModules
|
|
707
|
+
statForkedAvailableModules++;
|
|
708
|
+
statForkedAvailableModulesCount += availableModules.size;
|
|
709
|
+
statForkedMergedModulesCount += cachedMinAvailableModules.size;
|
|
710
|
+
// construct a new Set as intersection of cachedMinAvailableModules and availableModules
|
|
711
|
+
const newSet = new Set();
|
|
712
|
+
newSet.plus = availableModules.plus;
|
|
713
|
+
for (const m of availableModules) {
|
|
714
|
+
if (cachedMinAvailableModules.has(m)) {
|
|
715
|
+
newSet.add(m);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
statForkedResultModulesCount += newSet.size;
|
|
719
|
+
cachedMinAvailableModules = newSet;
|
|
720
|
+
info.minAvailableModulesOwned = true;
|
|
721
|
+
info.minAvailableModules = newSet;
|
|
722
|
+
changed = true;
|
|
723
|
+
continue;
|
|
724
|
+
}
|
|
725
|
+
for (const m of cachedMinAvailableModules) {
|
|
726
|
+
if (!availableModules.has(m)) {
|
|
727
|
+
// cachedMinAvailableModules need to be modified
|
|
728
|
+
// but we don't own it
|
|
729
|
+
statForkedAvailableModules++;
|
|
730
|
+
statForkedAvailableModulesCount += cachedMinAvailableModules.size;
|
|
731
|
+
statForkedMergedModulesCount += availableModules.size;
|
|
732
|
+
// construct a new Set as intersection of cachedMinAvailableModules and availableModules
|
|
733
|
+
// as the plus part is equal we can just take over this one
|
|
734
|
+
const newSet = new Set();
|
|
735
|
+
newSet.plus = availableModules.plus;
|
|
736
|
+
const iterator = cachedMinAvailableModules[Symbol.iterator]();
|
|
737
|
+
// fast forward add all modules until m
|
|
738
|
+
let it;
|
|
739
|
+
while (!(it = iterator.next()).done) {
|
|
740
|
+
const module = it.value;
|
|
741
|
+
if (module === m)
|
|
742
|
+
break;
|
|
743
|
+
newSet.add(module);
|
|
744
|
+
}
|
|
745
|
+
// check the remaining modules before adding
|
|
746
|
+
while (!(it = iterator.next()).done) {
|
|
747
|
+
const module = it.value;
|
|
748
|
+
if (availableModules.has(module)) {
|
|
749
|
+
newSet.add(module);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
statForkedResultModulesCount += newSet.size;
|
|
753
|
+
cachedMinAvailableModules = newSet;
|
|
754
|
+
info.minAvailableModulesOwned = true;
|
|
755
|
+
info.minAvailableModules = newSet;
|
|
756
|
+
changed = true;
|
|
757
|
+
continue merge;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
else {
|
|
762
|
+
for (const m of cachedMinAvailableModules) {
|
|
763
|
+
if (!availableModules.has(m) && !availableModules.plus.has(m)) {
|
|
764
|
+
// cachedMinAvailableModules need to be modified
|
|
765
|
+
// but we don't own it
|
|
766
|
+
statForkedAvailableModules++;
|
|
767
|
+
statForkedAvailableModulesCount += cachedMinAvailableModules.size;
|
|
768
|
+
statForkedAvailableModulesCountPlus += cachedMinAvailableModules.plus.size;
|
|
769
|
+
statForkedMergedModulesCount += availableModules.size;
|
|
770
|
+
statForkedMergedModulesCountPlus += availableModules.plus.size;
|
|
771
|
+
// construct a new Set as intersection of cachedMinAvailableModules and availableModules
|
|
772
|
+
const newSet = new Set();
|
|
773
|
+
newSet.plus = EMPTY_SET;
|
|
774
|
+
const iterator = cachedMinAvailableModules[Symbol.iterator]();
|
|
775
|
+
// fast forward add all modules until m
|
|
776
|
+
let it;
|
|
777
|
+
while (!(it = iterator.next()).done) {
|
|
778
|
+
const module = it.value;
|
|
779
|
+
if (module === m)
|
|
780
|
+
break;
|
|
781
|
+
newSet.add(module);
|
|
782
|
+
}
|
|
783
|
+
// check the remaining modules before adding
|
|
784
|
+
while (!(it = iterator.next()).done) {
|
|
785
|
+
const module = it.value;
|
|
786
|
+
if (availableModules.has(module) || availableModules.plus.has(module)) {
|
|
787
|
+
newSet.add(module);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
// also check all modules in cachedMinAvailableModules.plus
|
|
791
|
+
for (const module of cachedMinAvailableModules.plus) {
|
|
792
|
+
if (availableModules.has(module) || availableModules.plus.has(module)) {
|
|
793
|
+
newSet.add(module);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
statForkedResultModulesCount += newSet.size;
|
|
797
|
+
cachedMinAvailableModules = newSet;
|
|
798
|
+
info.minAvailableModulesOwned = true;
|
|
799
|
+
info.minAvailableModules = newSet;
|
|
800
|
+
changed = true;
|
|
801
|
+
continue merge;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
for (const m of cachedMinAvailableModules.plus) {
|
|
805
|
+
if (!availableModules.has(m) && !availableModules.plus.has(m)) {
|
|
806
|
+
// cachedMinAvailableModules need to be modified
|
|
807
|
+
// but we don't own it
|
|
808
|
+
statForkedAvailableModules++;
|
|
809
|
+
statForkedAvailableModulesCount += cachedMinAvailableModules.size;
|
|
810
|
+
statForkedAvailableModulesCountPlus += cachedMinAvailableModules.plus.size;
|
|
811
|
+
statForkedMergedModulesCount += availableModules.size;
|
|
812
|
+
statForkedMergedModulesCountPlus += availableModules.plus.size;
|
|
813
|
+
// construct a new Set as intersection of cachedMinAvailableModules and availableModules
|
|
814
|
+
// we already know that all modules directly from cachedMinAvailableModules are in availableModules too
|
|
815
|
+
const newSet = new Set(cachedMinAvailableModules);
|
|
816
|
+
newSet.plus = EMPTY_SET;
|
|
817
|
+
const iterator = cachedMinAvailableModules.plus[Symbol.iterator]();
|
|
818
|
+
// fast forward add all modules until m
|
|
819
|
+
let it;
|
|
820
|
+
while (!(it = iterator.next()).done) {
|
|
821
|
+
const module = it.value;
|
|
822
|
+
if (module === m)
|
|
823
|
+
break;
|
|
824
|
+
newSet.add(module);
|
|
825
|
+
}
|
|
826
|
+
// check the remaining modules before adding
|
|
827
|
+
while (!(it = iterator.next()).done) {
|
|
828
|
+
const module = it.value;
|
|
829
|
+
if (availableModules.has(module) || availableModules.plus.has(module)) {
|
|
830
|
+
newSet.add(module);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
statForkedResultModulesCount += newSet.size;
|
|
834
|
+
cachedMinAvailableModules = newSet;
|
|
835
|
+
info.minAvailableModulesOwned = true;
|
|
836
|
+
info.minAvailableModules = newSet;
|
|
837
|
+
changed = true;
|
|
838
|
+
continue merge;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
availableModulesToBeMerged.length = 0;
|
|
844
|
+
if (changed) {
|
|
845
|
+
info.resultingAvailableModules = undefined;
|
|
846
|
+
outdatedChunkGroupInfo.add(info);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
chunkGroupsForMerging.clear();
|
|
850
|
+
};
|
|
851
|
+
const processChunkGroupsForCombining = () => {
|
|
852
|
+
for (const info of chunkGroupsForCombining) {
|
|
853
|
+
for (const source of info.availableSources) {
|
|
854
|
+
if (!source.minAvailableModules) {
|
|
855
|
+
chunkGroupsForCombining.delete(info);
|
|
856
|
+
break;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
for (const info of chunkGroupsForCombining) {
|
|
861
|
+
const availableModules = new Set();
|
|
862
|
+
availableModules.plus = EMPTY_SET;
|
|
863
|
+
const mergeSet = set => {
|
|
864
|
+
if (set.size > availableModules.plus.size) {
|
|
865
|
+
for (const item of availableModules.plus)
|
|
866
|
+
availableModules.add(item);
|
|
867
|
+
availableModules.plus = set;
|
|
868
|
+
}
|
|
869
|
+
else {
|
|
870
|
+
for (const item of set)
|
|
871
|
+
availableModules.add(item);
|
|
872
|
+
}
|
|
873
|
+
};
|
|
874
|
+
// combine minAvailableModules from all resultingAvailableModules
|
|
875
|
+
for (const source of info.availableSources) {
|
|
876
|
+
const resultingAvailableModules = calculateResultingAvailableModules(source);
|
|
877
|
+
mergeSet(resultingAvailableModules);
|
|
878
|
+
mergeSet(resultingAvailableModules.plus);
|
|
879
|
+
}
|
|
880
|
+
info.minAvailableModules = availableModules;
|
|
881
|
+
info.minAvailableModulesOwned = false;
|
|
882
|
+
info.resultingAvailableModules = undefined;
|
|
883
|
+
outdatedChunkGroupInfo.add(info);
|
|
884
|
+
}
|
|
885
|
+
chunkGroupsForCombining.clear();
|
|
886
|
+
};
|
|
887
|
+
const processOutdatedChunkGroupInfo = () => {
|
|
888
|
+
statChunkGroupInfoUpdated += outdatedChunkGroupInfo.size;
|
|
889
|
+
// Revisit skipped elements
|
|
890
|
+
for (const info of outdatedChunkGroupInfo) {
|
|
891
|
+
// 1. Reconsider skipped items
|
|
892
|
+
if (info.skippedItems !== undefined) {
|
|
893
|
+
const minAvailableModules = info.minAvailableModules;
|
|
894
|
+
for (const module of info.skippedItems) {
|
|
895
|
+
if (!minAvailableModules.has(module) && !minAvailableModules.plus.has(module)) {
|
|
896
|
+
queue.push({
|
|
897
|
+
action: ADD_AND_ENTER_MODULE,
|
|
898
|
+
block: module,
|
|
899
|
+
module,
|
|
900
|
+
chunk: info.chunkGroup.chunks[0],
|
|
901
|
+
chunkGroup: info.chunkGroup,
|
|
902
|
+
chunkGroupInfo: info,
|
|
903
|
+
});
|
|
904
|
+
info.skippedItems.delete(module);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
// 2. Reconsider skipped connections
|
|
909
|
+
if (info.skippedModuleConnections !== undefined) {
|
|
910
|
+
const minAvailableModules = info.minAvailableModules;
|
|
911
|
+
for (const entry of info.skippedModuleConnections) {
|
|
912
|
+
const [module, activeState] = entry;
|
|
913
|
+
if (activeState === false)
|
|
914
|
+
continue;
|
|
915
|
+
if (activeState === true) {
|
|
916
|
+
info.skippedModuleConnections.delete(entry);
|
|
917
|
+
}
|
|
918
|
+
if (activeState === true &&
|
|
919
|
+
(minAvailableModules.has(module) || minAvailableModules.plus.has(module))) {
|
|
920
|
+
info.skippedItems.add(module);
|
|
921
|
+
continue;
|
|
922
|
+
}
|
|
923
|
+
queue.push({
|
|
924
|
+
action: activeState === true ? ADD_AND_ENTER_MODULE : PROCESS_BLOCK,
|
|
925
|
+
block: module,
|
|
926
|
+
module,
|
|
927
|
+
chunk: info.chunkGroup.chunks[0],
|
|
928
|
+
chunkGroup: info.chunkGroup,
|
|
929
|
+
chunkGroupInfo: info,
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
// 2. Reconsider children chunk groups
|
|
934
|
+
if (info.children !== undefined) {
|
|
935
|
+
statChildChunkGroupsReconnected += info.children.size;
|
|
936
|
+
for (const cgi of info.children) {
|
|
937
|
+
let connectList = queueConnect.get(info);
|
|
938
|
+
if (connectList === undefined) {
|
|
939
|
+
connectList = new Set();
|
|
940
|
+
queueConnect.set(info, connectList);
|
|
941
|
+
}
|
|
942
|
+
connectList.add(cgi);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
// 3. Reconsider chunk groups for combining
|
|
946
|
+
if (info.availableChildren !== undefined) {
|
|
947
|
+
for (const cgi of info.availableChildren) {
|
|
948
|
+
chunkGroupsForCombining.add(cgi);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
outdatedChunkGroupInfo.clear();
|
|
953
|
+
};
|
|
954
|
+
// Iterative traversal of the Module graph
|
|
955
|
+
// Recursive would be simpler to write but could result in Stack Overflows
|
|
956
|
+
while (queue.length || queueConnect.size) {
|
|
957
|
+
logger.time('visitModules: visiting');
|
|
958
|
+
processQueue();
|
|
959
|
+
logger.timeAggregateEnd('visitModules: prepare');
|
|
960
|
+
logger.timeEnd('visitModules: visiting');
|
|
961
|
+
if (chunkGroupsForCombining.size > 0) {
|
|
962
|
+
logger.time('visitModules: combine available modules');
|
|
963
|
+
processChunkGroupsForCombining();
|
|
964
|
+
logger.timeEnd('visitModules: combine available modules');
|
|
965
|
+
}
|
|
966
|
+
if (queueConnect.size > 0) {
|
|
967
|
+
logger.time('visitModules: calculating available modules');
|
|
968
|
+
processConnectQueue();
|
|
969
|
+
logger.timeEnd('visitModules: calculating available modules');
|
|
970
|
+
if (chunkGroupsForMerging.size > 0) {
|
|
971
|
+
logger.time('visitModules: merging available modules');
|
|
972
|
+
processChunkGroupsForMerging();
|
|
973
|
+
logger.timeEnd('visitModules: merging available modules');
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
if (outdatedChunkGroupInfo.size > 0) {
|
|
977
|
+
logger.time('visitModules: check modules for revisit');
|
|
978
|
+
processOutdatedChunkGroupInfo();
|
|
979
|
+
logger.timeEnd('visitModules: check modules for revisit');
|
|
980
|
+
}
|
|
981
|
+
// Run queueDelayed when all items of the queue are processed
|
|
982
|
+
// This is important to get the global indexing correct
|
|
983
|
+
// Async blocks should be processed after all sync blocks are processed
|
|
984
|
+
if (queue.length === 0) {
|
|
985
|
+
const tempQueue = queue;
|
|
986
|
+
queue = queueDelayed.reverse();
|
|
987
|
+
queueDelayed = tempQueue;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
logger.log(`${statProcessedQueueItems} queue items processed (${statProcessedBlocks} blocks)`);
|
|
991
|
+
logger.log(`${statConnectedChunkGroups} chunk groups connected`);
|
|
992
|
+
logger.log(`${statProcessedChunkGroupsForMerging} chunk groups processed for merging (${statMergedAvailableModuleSets} module sets, ${statForkedAvailableModules} forked, ${statForkedAvailableModulesCount} + ${statForkedAvailableModulesCountPlus} modules forked, ${statForkedMergedModulesCount} + ${statForkedMergedModulesCountPlus} modules merged into fork, ${statForkedResultModulesCount} resulting modules)`);
|
|
993
|
+
logger.log(`${statChunkGroupInfoUpdated} chunk group info updated (${statChildChunkGroupsReconnected} already connected chunk groups reconnected)`);
|
|
994
|
+
};
|
|
995
|
+
const connectChunkGroups = (compilation, blocksWithNestedBlocks, blockConnections, chunkGroupInfoMap) => {
|
|
996
|
+
const { chunkGraph } = compilation;
|
|
997
|
+
const areModulesAvailable = (chunkGroup, availableModules) => {
|
|
998
|
+
for (const chunk of chunkGroup.chunks) {
|
|
999
|
+
for (const module of chunkGraph.getChunkModulesIterable(chunk)) {
|
|
1000
|
+
if (!availableModules.has(module) && !availableModules.plus.has(module))
|
|
1001
|
+
return false;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
return true;
|
|
1005
|
+
};
|
|
1006
|
+
// For each edge in the basic chunk graph
|
|
1007
|
+
for (const [block, connections] of blockConnections) {
|
|
1008
|
+
// 1. Check if connection is needed
|
|
1009
|
+
// When none of the dependencies need to be connected
|
|
1010
|
+
// we can skip all of them
|
|
1011
|
+
// It's not possible to filter each item so it doesn't create inconsistent
|
|
1012
|
+
// connections and modules can only create one version
|
|
1013
|
+
// TODO maybe decide this per runtime
|
|
1014
|
+
if (
|
|
1015
|
+
// TODO is this needed?
|
|
1016
|
+
!blocksWithNestedBlocks.has(block) &&
|
|
1017
|
+
connections.every(({ chunkGroup, originChunkGroupInfo }) => areModulesAvailable(chunkGroup, originChunkGroupInfo.resultingAvailableModules))) {
|
|
1018
|
+
continue;
|
|
1019
|
+
}
|
|
1020
|
+
// 2. Foreach edge
|
|
1021
|
+
for (let i = 0; i < connections.length; i++) {
|
|
1022
|
+
const { chunkGroup, originChunkGroupInfo } = connections[i];
|
|
1023
|
+
// 3. Connect block with chunk
|
|
1024
|
+
chunkGraph.connectBlockAndChunkGroup(block, chunkGroup);
|
|
1025
|
+
// 4. Connect chunk with parent
|
|
1026
|
+
(0, GraphHelpers_1.connectChunkGroupParentAndChild)(originChunkGroupInfo.chunkGroup, chunkGroup);
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
const cleanupUnconnectedGroups = (compilation, allCreatedChunkGroups) => {
|
|
1031
|
+
const { chunkGraph } = compilation;
|
|
1032
|
+
for (const chunkGroup of allCreatedChunkGroups) {
|
|
1033
|
+
if (chunkGroup.getNumberOfParents() === 0) {
|
|
1034
|
+
for (const chunk of chunkGroup.chunks) {
|
|
1035
|
+
compilation.chunks.delete(chunk);
|
|
1036
|
+
chunkGraph.disconnectChunk(chunk);
|
|
1037
|
+
}
|
|
1038
|
+
chunkGraph.disconnectChunkGroup(chunkGroup);
|
|
1039
|
+
chunkGroup.remove();
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
};
|
|
1043
|
+
const buildChunkGraph = (compilation, inputEntrypointsAndModules) => {
|
|
1044
|
+
const logger = compilation.getLogger('webpack.buildChunkGraph');
|
|
1045
|
+
// SHARED STATE
|
|
1046
|
+
const blockConnections = new Map();
|
|
1047
|
+
const allCreatedChunkGroups = new Set();
|
|
1048
|
+
const chunkGroupInfoMap = new Map();
|
|
1049
|
+
const blocksWithNestedBlocks = new Set();
|
|
1050
|
+
// PART ONE
|
|
1051
|
+
logger.time('visitModules');
|
|
1052
|
+
visitModules(logger, compilation, inputEntrypointsAndModules, chunkGroupInfoMap, blockConnections, blocksWithNestedBlocks, allCreatedChunkGroups);
|
|
1053
|
+
logger.timeEnd('visitModules');
|
|
1054
|
+
// PART TWO
|
|
1055
|
+
logger.time('connectChunkGroups');
|
|
1056
|
+
connectChunkGroups(compilation, blocksWithNestedBlocks, blockConnections, chunkGroupInfoMap);
|
|
1057
|
+
logger.timeEnd('connectChunkGroups');
|
|
1058
|
+
for (const [chunkGroup, chunkGroupInfo] of chunkGroupInfoMap) {
|
|
1059
|
+
for (const chunk of chunkGroup.chunks)
|
|
1060
|
+
chunk.runtime = (0, RuntimeHelpers_1.mergeRuntime)(chunk.runtime, chunkGroupInfo.runtime);
|
|
1061
|
+
}
|
|
1062
|
+
// Cleanup work
|
|
1063
|
+
logger.time('cleanup');
|
|
1064
|
+
cleanupUnconnectedGroups(compilation, allCreatedChunkGroups);
|
|
1065
|
+
logger.timeEnd('cleanup');
|
|
1066
|
+
};
|
|
1067
|
+
exports.default = buildChunkGraph;
|