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,844 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const webpack_sources_1 = require("webpack-sources");
|
|
30
|
+
const HookBaseError_1 = require("@/base/errors/HookBaseError");
|
|
31
|
+
const Template_1 = require("@/template/Template");
|
|
32
|
+
const BaseError_1 = __importDefault(require("@/base/errors/BaseError"));
|
|
33
|
+
const comparators_1 = require("@/base/comparators");
|
|
34
|
+
const identifier_1 = require("@/base/identifier");
|
|
35
|
+
const makeSerializable_1 = __importDefault(require("@/serialization/makeSerializable"));
|
|
36
|
+
const RuntimeGlobals = __importStar(require("./RuntimeGlobals"));
|
|
37
|
+
const ModuleTypeConstants_1 = require("./ModuleTypeConstants");
|
|
38
|
+
const Module_1 = __importDefault(require("./Module"));
|
|
39
|
+
const AsyncDependenciesBlock_1 = __importDefault(require("../dependencies/AsyncDependenciesBlock"));
|
|
40
|
+
const SNAPSHOT_OPTIONS = { timestamp: true };
|
|
41
|
+
const TYPES = new Set(['javascript']);
|
|
42
|
+
class ContextModule extends Module_1.default {
|
|
43
|
+
constructor(resolveDependencies, options) {
|
|
44
|
+
if (!options || typeof options.resource === 'string') {
|
|
45
|
+
const parsed = (0, identifier_1.parseResource)(options ? options.resource : '');
|
|
46
|
+
const resource = parsed.path;
|
|
47
|
+
const resourceQuery = (options === null || options === void 0 ? void 0 : options.resourceQuery) || parsed.query;
|
|
48
|
+
const resourceFragment = (options === null || options === void 0 ? void 0 : options.resourceFragment) || parsed.fragment;
|
|
49
|
+
const layer = options === null || options === void 0 ? void 0 : options.layer;
|
|
50
|
+
super(ModuleTypeConstants_1.JAVASCRIPT_MODULE_TYPE_DYNAMIC, resource, layer);
|
|
51
|
+
this.options = Object.assign(Object.assign({}, options), { resource,
|
|
52
|
+
resourceQuery,
|
|
53
|
+
resourceFragment });
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
super(ModuleTypeConstants_1.JAVASCRIPT_MODULE_TYPE_DYNAMIC, undefined, options.layer);
|
|
57
|
+
this.options = Object.assign(Object.assign({}, options), { resource: options.resource, resourceQuery: options.resourceQuery || '', resourceFragment: options.resourceFragment || '' });
|
|
58
|
+
}
|
|
59
|
+
// Info from Factory
|
|
60
|
+
this.resolveDependencies = resolveDependencies;
|
|
61
|
+
if ((options === null || options === void 0 ? void 0 : options.resolveOptions) !== undefined) {
|
|
62
|
+
this.resolveOptions = options.resolveOptions;
|
|
63
|
+
}
|
|
64
|
+
if (options && typeof options.mode !== 'string') {
|
|
65
|
+
throw new Error('options.mode is a required option');
|
|
66
|
+
}
|
|
67
|
+
this._identifier = this._createIdentifier();
|
|
68
|
+
this._forceBuild = true;
|
|
69
|
+
}
|
|
70
|
+
getSourceTypes() {
|
|
71
|
+
return TYPES;
|
|
72
|
+
}
|
|
73
|
+
updateCacheModule(module) {
|
|
74
|
+
const m = module;
|
|
75
|
+
this.resolveDependencies = m.resolveDependencies;
|
|
76
|
+
this.options = m.options;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Assuming this module is in the cache. Remove internal references to allow freeing some memory.
|
|
80
|
+
*/
|
|
81
|
+
cleanupForCache() {
|
|
82
|
+
super.cleanupForCache();
|
|
83
|
+
this.resolveDependencies = undefined;
|
|
84
|
+
}
|
|
85
|
+
_prettyRegExp(regexString, stripSlash = true) {
|
|
86
|
+
const str = (`${regexString}`).replace(/!/g, '%21').replace(/\|/g, '%7C');
|
|
87
|
+
return stripSlash ? str.substring(1, str.length - 1) : str;
|
|
88
|
+
}
|
|
89
|
+
_createIdentifier() {
|
|
90
|
+
let identifier = this.context ||
|
|
91
|
+
(typeof this.options.resource === 'string' || this.options.resource === false
|
|
92
|
+
? `${this.options.resource}`
|
|
93
|
+
: this.options.resource.join('|'));
|
|
94
|
+
if (this.options.resourceQuery) {
|
|
95
|
+
identifier += `|${this.options.resourceQuery}`;
|
|
96
|
+
}
|
|
97
|
+
if (this.options.resourceFragment) {
|
|
98
|
+
identifier += `|${this.options.resourceFragment}`;
|
|
99
|
+
}
|
|
100
|
+
if (this.options.mode) {
|
|
101
|
+
identifier += `|${this.options.mode}`;
|
|
102
|
+
}
|
|
103
|
+
if (!this.options.recursive) {
|
|
104
|
+
identifier += '|nonrecursive';
|
|
105
|
+
}
|
|
106
|
+
if (this.options.addon) {
|
|
107
|
+
identifier += `|${this.options.addon}`;
|
|
108
|
+
}
|
|
109
|
+
if (this.options.regExp) {
|
|
110
|
+
identifier += `|${this._prettyRegExp(this.options.regExp, false)}`;
|
|
111
|
+
}
|
|
112
|
+
if (this.options.include) {
|
|
113
|
+
identifier += `|include: ${this._prettyRegExp(this.options.include, false)}`;
|
|
114
|
+
}
|
|
115
|
+
if (this.options.exclude) {
|
|
116
|
+
identifier += `|exclude: ${this._prettyRegExp(this.options.exclude, false)}`;
|
|
117
|
+
}
|
|
118
|
+
if (this.options.referencedExports) {
|
|
119
|
+
identifier += `|referencedExports: ${JSON.stringify(this.options.referencedExports)}`;
|
|
120
|
+
}
|
|
121
|
+
if (this.options.chunkName) {
|
|
122
|
+
identifier += `|chunkName: ${this.options.chunkName}`;
|
|
123
|
+
}
|
|
124
|
+
if (this.options.groupOptions) {
|
|
125
|
+
identifier += `|groupOptions: ${JSON.stringify(this.options.groupOptions)}`;
|
|
126
|
+
}
|
|
127
|
+
if (this.options.namespaceObject === 'strict') {
|
|
128
|
+
identifier += '|strict namespace object';
|
|
129
|
+
}
|
|
130
|
+
else if (this.options.namespaceObject) {
|
|
131
|
+
identifier += '|namespace object';
|
|
132
|
+
}
|
|
133
|
+
if (this.layer) {
|
|
134
|
+
identifier += `|layer: ${this.layer}`;
|
|
135
|
+
}
|
|
136
|
+
return identifier;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* @returns {string} a unique identifier of the module
|
|
140
|
+
*/
|
|
141
|
+
identifier() {
|
|
142
|
+
return this._identifier;
|
|
143
|
+
}
|
|
144
|
+
readableIdentifier(requestShortener) {
|
|
145
|
+
let identifier;
|
|
146
|
+
if (this.context) {
|
|
147
|
+
identifier = `${requestShortener.shorten(this.context)}/`;
|
|
148
|
+
}
|
|
149
|
+
else if (typeof this.options.resource === 'string' || this.options.resource === false) {
|
|
150
|
+
identifier = `${requestShortener.shorten(`${this.options.resource}`)}/`;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
identifier = this.options.resource.map(r => `${requestShortener.shorten(r)}/`).join(' ');
|
|
154
|
+
}
|
|
155
|
+
if (this.options.resourceQuery) {
|
|
156
|
+
identifier += ` ${this.options.resourceQuery}`;
|
|
157
|
+
}
|
|
158
|
+
if (this.options.mode) {
|
|
159
|
+
identifier += ` ${this.options.mode}`;
|
|
160
|
+
}
|
|
161
|
+
if (!this.options.recursive) {
|
|
162
|
+
identifier += ' nonrecursive';
|
|
163
|
+
}
|
|
164
|
+
if (this.options.addon) {
|
|
165
|
+
identifier += ` ${requestShortener.shorten(this.options.addon)}`;
|
|
166
|
+
}
|
|
167
|
+
if (this.options.regExp) {
|
|
168
|
+
identifier += ` ${this._prettyRegExp(this.options.regExp)}`;
|
|
169
|
+
}
|
|
170
|
+
if (this.options.include) {
|
|
171
|
+
identifier += ` include: ${this._prettyRegExp(this.options.include)}`;
|
|
172
|
+
}
|
|
173
|
+
if (this.options.exclude) {
|
|
174
|
+
identifier += ` exclude: ${this._prettyRegExp(this.options.exclude)}`;
|
|
175
|
+
}
|
|
176
|
+
if (this.options.referencedExports) {
|
|
177
|
+
identifier += ` referencedExports: ${this.options.referencedExports
|
|
178
|
+
.map(e => e.join('.'))
|
|
179
|
+
.join(', ')}`;
|
|
180
|
+
}
|
|
181
|
+
if (this.options.chunkName) {
|
|
182
|
+
identifier += ` chunkName: ${this.options.chunkName}`;
|
|
183
|
+
}
|
|
184
|
+
if (this.options.groupOptions) {
|
|
185
|
+
const groupOptions = this.options.groupOptions;
|
|
186
|
+
for (const key of Object.keys(groupOptions)) {
|
|
187
|
+
identifier += ` ${key}: ${groupOptions[key]}`;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (this.options.namespaceObject === 'strict') {
|
|
191
|
+
identifier += ' strict namespace object';
|
|
192
|
+
}
|
|
193
|
+
else if (this.options.namespaceObject) {
|
|
194
|
+
identifier += ' namespace object';
|
|
195
|
+
}
|
|
196
|
+
return identifier;
|
|
197
|
+
}
|
|
198
|
+
libIdent(options) {
|
|
199
|
+
let identifier;
|
|
200
|
+
if (this.context) {
|
|
201
|
+
identifier = (0, identifier_1.contextify)(options.context, this.context, options.associatedObjectForCache);
|
|
202
|
+
}
|
|
203
|
+
else if (typeof this.options.resource === 'string') {
|
|
204
|
+
identifier = (0, identifier_1.contextify)(options.context, this.options.resource, options.associatedObjectForCache);
|
|
205
|
+
}
|
|
206
|
+
else if (this.options.resource === false) {
|
|
207
|
+
identifier = 'false';
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
identifier = this.options.resource
|
|
211
|
+
.map(res => (0, identifier_1.contextify)(options.context, res, options.associatedObjectForCache))
|
|
212
|
+
.join(' ');
|
|
213
|
+
}
|
|
214
|
+
if (this.layer)
|
|
215
|
+
identifier = `(${this.layer})/${identifier}`;
|
|
216
|
+
if (this.options.mode) {
|
|
217
|
+
identifier += ` ${this.options.mode}`;
|
|
218
|
+
}
|
|
219
|
+
if (this.options.recursive) {
|
|
220
|
+
identifier += ' recursive';
|
|
221
|
+
}
|
|
222
|
+
if (this.options.addon) {
|
|
223
|
+
identifier += ` ${(0, identifier_1.contextify)(options.context, this.options.addon, options.associatedObjectForCache)}`;
|
|
224
|
+
}
|
|
225
|
+
if (this.options.regExp) {
|
|
226
|
+
identifier += ` ${this._prettyRegExp(this.options.regExp)}`;
|
|
227
|
+
}
|
|
228
|
+
if (this.options.include) {
|
|
229
|
+
identifier += ` include: ${this._prettyRegExp(this.options.include)}`;
|
|
230
|
+
}
|
|
231
|
+
if (this.options.exclude) {
|
|
232
|
+
identifier += ` exclude: ${this._prettyRegExp(this.options.exclude)}`;
|
|
233
|
+
}
|
|
234
|
+
if (this.options.referencedExports) {
|
|
235
|
+
identifier += ` referencedExports: ${this.options.referencedExports
|
|
236
|
+
.map(e => e.join('.'))
|
|
237
|
+
.join(', ')}`;
|
|
238
|
+
}
|
|
239
|
+
return identifier;
|
|
240
|
+
}
|
|
241
|
+
invalidateBuild() {
|
|
242
|
+
this._forceBuild = true;
|
|
243
|
+
}
|
|
244
|
+
needBuild({ fileSystemInfo }, callback) {
|
|
245
|
+
// build if enforced
|
|
246
|
+
if (this._forceBuild)
|
|
247
|
+
return callback(null, true);
|
|
248
|
+
// always build when we have no snapshot and context
|
|
249
|
+
if (!this.buildInfo.snapshot)
|
|
250
|
+
return callback(null, Boolean(this.context || this.options.resource));
|
|
251
|
+
fileSystemInfo.checkSnapshotValid(this.buildInfo.snapshot, (err, valid) => {
|
|
252
|
+
callback(err, !valid);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
build(options, compilation, resolver, fs, callback) {
|
|
256
|
+
this._forceBuild = false;
|
|
257
|
+
this.buildMeta = {
|
|
258
|
+
exportsType: 'default',
|
|
259
|
+
defaultObject: 'redirect-warn',
|
|
260
|
+
};
|
|
261
|
+
this.buildInfo = {
|
|
262
|
+
snapshot: undefined,
|
|
263
|
+
};
|
|
264
|
+
this.dependencies.length = 0;
|
|
265
|
+
this.blocks.length = 0;
|
|
266
|
+
const startTime = Date.now();
|
|
267
|
+
this.resolveDependencies(fs, this.options, (err, dependencies) => {
|
|
268
|
+
if (err) {
|
|
269
|
+
return callback((0, HookBaseError_1.makeBaseError)(err, 'ContextModule.resolveDependencies'));
|
|
270
|
+
}
|
|
271
|
+
// abort if something failed
|
|
272
|
+
// this will create an empty context
|
|
273
|
+
if (!dependencies) {
|
|
274
|
+
callback();
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
// enhance dependencies with meta info
|
|
278
|
+
for (const dep of dependencies) {
|
|
279
|
+
dep.loc = {
|
|
280
|
+
name: dep.userRequest,
|
|
281
|
+
};
|
|
282
|
+
dep.request = this.options.addon + dep.request;
|
|
283
|
+
}
|
|
284
|
+
dependencies.sort((0, comparators_1.concatComparators)((0, comparators_1.compareSelect)(a => a.loc, comparators_1.compareLocations), (0, comparators_1.keepOriginalOrder)(this.dependencies)));
|
|
285
|
+
if (this.options.mode === 'sync' || this.options.mode === 'eager') {
|
|
286
|
+
// if we have an sync or eager context
|
|
287
|
+
// just add all dependencies and continue
|
|
288
|
+
this.dependencies = dependencies;
|
|
289
|
+
}
|
|
290
|
+
else if (this.options.mode === 'lazy-once') {
|
|
291
|
+
// for the lazy-once mode create a new async dependency block
|
|
292
|
+
// and add that block to this context
|
|
293
|
+
if (dependencies.length > 0) {
|
|
294
|
+
const block = new AsyncDependenciesBlock_1.default(Object.assign(Object.assign({}, this.options.groupOptions), { name: this.options.chunkName }));
|
|
295
|
+
for (const dep of dependencies) {
|
|
296
|
+
block.addDependency(dep);
|
|
297
|
+
}
|
|
298
|
+
this.addBlock(block);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
else if (this.options.mode === 'weak' || this.options.mode === 'async-weak') {
|
|
302
|
+
// we mark all dependencies as weak
|
|
303
|
+
for (const dep of dependencies) {
|
|
304
|
+
dep.weak = true;
|
|
305
|
+
}
|
|
306
|
+
this.dependencies = dependencies;
|
|
307
|
+
}
|
|
308
|
+
else if (this.options.mode === 'lazy') {
|
|
309
|
+
// if we are lazy create a new async dependency block per dependency
|
|
310
|
+
// and add all blocks to this context
|
|
311
|
+
let index = 0;
|
|
312
|
+
for (const dep of dependencies) {
|
|
313
|
+
let chunkName = this.options.chunkName;
|
|
314
|
+
if (chunkName) {
|
|
315
|
+
if (!/\[(index|request)\]/.test(chunkName)) {
|
|
316
|
+
chunkName += '[index]';
|
|
317
|
+
}
|
|
318
|
+
chunkName = chunkName.replace(/\[index\]/g, `${index++}`);
|
|
319
|
+
chunkName = chunkName.replace(/\[request\]/g, Template_1.Template.toPath(dep.userRequest));
|
|
320
|
+
}
|
|
321
|
+
const block = new AsyncDependenciesBlock_1.default(Object.assign(Object.assign({}, this.options.groupOptions), { name: chunkName }), dep.loc, dep.userRequest);
|
|
322
|
+
block.addDependency(dep);
|
|
323
|
+
this.addBlock(block);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
callback(new BaseError_1.default(`Unsupported mode "${this.options.mode}" in context`));
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
if (!this.context && !this.options.resource)
|
|
331
|
+
return callback();
|
|
332
|
+
compilation.fileSystemInfo.createSnapshot(startTime, null, this.context
|
|
333
|
+
? [this.context]
|
|
334
|
+
: typeof this.options.resource === 'string'
|
|
335
|
+
? [this.options.resource]
|
|
336
|
+
: this.options.resource, null, SNAPSHOT_OPTIONS, (err, snapshot) => {
|
|
337
|
+
if (err)
|
|
338
|
+
return callback(err);
|
|
339
|
+
this.buildInfo.snapshot = snapshot;
|
|
340
|
+
callback();
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
addCacheDependencies(fileDependencies, contextDependencies, missingDependencies, buildDependencies) {
|
|
345
|
+
if (this.context) {
|
|
346
|
+
contextDependencies.add(this.context);
|
|
347
|
+
}
|
|
348
|
+
else if (typeof this.options.resource === 'string') {
|
|
349
|
+
contextDependencies.add(this.options.resource);
|
|
350
|
+
}
|
|
351
|
+
else if (this.options.resource === false) {
|
|
352
|
+
// eslint-disable-next-line no-useless-return
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
for (const res of this.options.resource)
|
|
357
|
+
contextDependencies.add(res);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
getUserRequestMap(dependencies, chunkGraph) {
|
|
361
|
+
const moduleGraph = chunkGraph.moduleGraph;
|
|
362
|
+
// if we filter first we get a new array
|
|
363
|
+
// therefore we don't need to create a clone of dependencies explicitly
|
|
364
|
+
// therefore the order of this is !important!
|
|
365
|
+
const sortedDependencies = dependencies
|
|
366
|
+
.filter(dependency => moduleGraph.getModule(dependency))
|
|
367
|
+
.sort((a, b) => {
|
|
368
|
+
if (a.userRequest === b.userRequest) {
|
|
369
|
+
return 0;
|
|
370
|
+
}
|
|
371
|
+
return a.userRequest < b.userRequest ? -1 : 1;
|
|
372
|
+
});
|
|
373
|
+
const map = Object.create(null);
|
|
374
|
+
for (const dep of sortedDependencies) {
|
|
375
|
+
const module = moduleGraph.getModule(dep);
|
|
376
|
+
map[dep.userRequest] = chunkGraph.getModuleId(module);
|
|
377
|
+
}
|
|
378
|
+
return map;
|
|
379
|
+
}
|
|
380
|
+
getFakeMap(dependencies, chunkGraph) {
|
|
381
|
+
if (!this.options.namespaceObject) {
|
|
382
|
+
return 9;
|
|
383
|
+
}
|
|
384
|
+
const moduleGraph = chunkGraph.moduleGraph;
|
|
385
|
+
// bitfield
|
|
386
|
+
let hasType = 0;
|
|
387
|
+
const comparator = (0, comparators_1.compareModulesById)(chunkGraph);
|
|
388
|
+
// if we filter first we get a new array
|
|
389
|
+
// therefore we don't need to create a clone of dependencies explicitly
|
|
390
|
+
// therefore the order of this is !important!
|
|
391
|
+
const sortedModules = dependencies
|
|
392
|
+
.map(dependency => moduleGraph.getModule(dependency))
|
|
393
|
+
.filter(Boolean)
|
|
394
|
+
.sort(comparator);
|
|
395
|
+
const fakeMap = Object.create(null);
|
|
396
|
+
for (const module of sortedModules) {
|
|
397
|
+
const exportsType = module.getExportsType(moduleGraph, this.options.namespaceObject === 'strict');
|
|
398
|
+
const id = chunkGraph.getModuleId(module);
|
|
399
|
+
switch (exportsType) {
|
|
400
|
+
case 'namespace':
|
|
401
|
+
fakeMap[id] = 9;
|
|
402
|
+
hasType |= 1;
|
|
403
|
+
break;
|
|
404
|
+
case 'dynamic':
|
|
405
|
+
fakeMap[id] = 7;
|
|
406
|
+
hasType |= 2;
|
|
407
|
+
break;
|
|
408
|
+
case 'default-only':
|
|
409
|
+
fakeMap[id] = 1;
|
|
410
|
+
hasType |= 4;
|
|
411
|
+
break;
|
|
412
|
+
case 'default-with-named':
|
|
413
|
+
fakeMap[id] = 3;
|
|
414
|
+
hasType |= 8;
|
|
415
|
+
break;
|
|
416
|
+
default:
|
|
417
|
+
throw new Error(`Unexpected exports type ${exportsType}`);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
if (hasType === 1) {
|
|
421
|
+
return 9;
|
|
422
|
+
}
|
|
423
|
+
if (hasType === 2) {
|
|
424
|
+
return 7;
|
|
425
|
+
}
|
|
426
|
+
if (hasType === 4) {
|
|
427
|
+
return 1;
|
|
428
|
+
}
|
|
429
|
+
if (hasType === 8) {
|
|
430
|
+
return 3;
|
|
431
|
+
}
|
|
432
|
+
if (hasType === 0) {
|
|
433
|
+
return 9;
|
|
434
|
+
}
|
|
435
|
+
return fakeMap;
|
|
436
|
+
}
|
|
437
|
+
getFakeMapInitStatement(fakeMap) {
|
|
438
|
+
return typeof fakeMap === 'object'
|
|
439
|
+
? `var fakeMap = ${JSON.stringify(fakeMap, null, '\t')};`
|
|
440
|
+
: '';
|
|
441
|
+
}
|
|
442
|
+
getReturn(type, asyncModule) {
|
|
443
|
+
if (type === 9) {
|
|
444
|
+
return `${RuntimeGlobals.require}(id)`;
|
|
445
|
+
}
|
|
446
|
+
return `${RuntimeGlobals.createFakeNamespaceObject}(id, ${type}${asyncModule ? ' | 16' : ''})`;
|
|
447
|
+
}
|
|
448
|
+
getReturnModuleObjectSource(fakeMap, asyncModule, fakeMapDataExpression = 'fakeMap[id]') {
|
|
449
|
+
if (typeof fakeMap === 'number') {
|
|
450
|
+
return `return ${this.getReturn(fakeMap, asyncModule)};`;
|
|
451
|
+
}
|
|
452
|
+
return `return ${RuntimeGlobals.createFakeNamespaceObject}(id, ${fakeMapDataExpression}${asyncModule ? ' | 16' : ''})`;
|
|
453
|
+
}
|
|
454
|
+
getSyncSource(dependencies, id, chunkGraph) {
|
|
455
|
+
const map = this.getUserRequestMap(dependencies, chunkGraph);
|
|
456
|
+
const fakeMap = this.getFakeMap(dependencies, chunkGraph);
|
|
457
|
+
const returnModuleObject = this.getReturnModuleObjectSource(fakeMap);
|
|
458
|
+
return `var map = ${JSON.stringify(map, null, '\t')};
|
|
459
|
+
${this.getFakeMapInitStatement(fakeMap)}
|
|
460
|
+
|
|
461
|
+
function webpackContext(req) {
|
|
462
|
+
var id = webpackContextResolve(req);
|
|
463
|
+
${returnModuleObject}
|
|
464
|
+
}
|
|
465
|
+
function webpackContextResolve(req) {
|
|
466
|
+
if(!${RuntimeGlobals.hasOwnProperty}(map, req)) {
|
|
467
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
468
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
469
|
+
throw e;
|
|
470
|
+
}
|
|
471
|
+
return map[req];
|
|
472
|
+
}
|
|
473
|
+
webpackContext.keys = function webpackContextKeys() {
|
|
474
|
+
return Object.keys(map);
|
|
475
|
+
};
|
|
476
|
+
webpackContext.resolve = webpackContextResolve;
|
|
477
|
+
module.exports = webpackContext;
|
|
478
|
+
webpackContext.id = ${JSON.stringify(id)};`;
|
|
479
|
+
}
|
|
480
|
+
getWeakSyncSource(dependencies, id, chunkGraph) {
|
|
481
|
+
const map = this.getUserRequestMap(dependencies, chunkGraph);
|
|
482
|
+
const fakeMap = this.getFakeMap(dependencies, chunkGraph);
|
|
483
|
+
const returnModuleObject = this.getReturnModuleObjectSource(fakeMap);
|
|
484
|
+
return `var map = ${JSON.stringify(map, null, '\t')};
|
|
485
|
+
${this.getFakeMapInitStatement(fakeMap)}
|
|
486
|
+
|
|
487
|
+
function webpackContext(req) {
|
|
488
|
+
var id = webpackContextResolve(req);
|
|
489
|
+
if(!${RuntimeGlobals.moduleFactories}[id]) {
|
|
490
|
+
var e = new Error("Module '" + req + "' ('" + id + "') is not available (weak dependency)");
|
|
491
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
492
|
+
throw e;
|
|
493
|
+
}
|
|
494
|
+
${returnModuleObject}
|
|
495
|
+
}
|
|
496
|
+
function webpackContextResolve(req) {
|
|
497
|
+
if(!${RuntimeGlobals.hasOwnProperty}(map, req)) {
|
|
498
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
499
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
500
|
+
throw e;
|
|
501
|
+
}
|
|
502
|
+
return map[req];
|
|
503
|
+
}
|
|
504
|
+
webpackContext.keys = function webpackContextKeys() {
|
|
505
|
+
return Object.keys(map);
|
|
506
|
+
};
|
|
507
|
+
webpackContext.resolve = webpackContextResolve;
|
|
508
|
+
webpackContext.id = ${JSON.stringify(id)};
|
|
509
|
+
module.exports = webpackContext;`;
|
|
510
|
+
}
|
|
511
|
+
getAsyncWeakSource(dependencies, id, { chunkGraph, runtimeTemplate }) {
|
|
512
|
+
const arrow = runtimeTemplate.supportsArrowFunction();
|
|
513
|
+
const map = this.getUserRequestMap(dependencies, chunkGraph);
|
|
514
|
+
const fakeMap = this.getFakeMap(dependencies, chunkGraph);
|
|
515
|
+
const returnModuleObject = this.getReturnModuleObjectSource(fakeMap, true);
|
|
516
|
+
return `var map = ${JSON.stringify(map, null, '\t')};
|
|
517
|
+
${this.getFakeMapInitStatement(fakeMap)}
|
|
518
|
+
|
|
519
|
+
function webpackAsyncContext(req) {
|
|
520
|
+
return webpackAsyncContextResolve(req).then(${arrow ? 'id =>' : 'function(id)'} {
|
|
521
|
+
if(!${RuntimeGlobals.moduleFactories}[id]) {
|
|
522
|
+
var e = new Error("Module '" + req + "' ('" + id + "') is not available (weak dependency)");
|
|
523
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
524
|
+
throw e;
|
|
525
|
+
}
|
|
526
|
+
${returnModuleObject}
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
function webpackAsyncContextResolve(req) {
|
|
530
|
+
// Here Promise.resolve().then() is used instead of new Promise() to prevent
|
|
531
|
+
// uncaught exception popping up in devtools
|
|
532
|
+
return Promise.resolve().then(${arrow ? '() =>' : 'function()'} {
|
|
533
|
+
if(!${RuntimeGlobals.hasOwnProperty}(map, req)) {
|
|
534
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
535
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
536
|
+
throw e;
|
|
537
|
+
}
|
|
538
|
+
return map[req];
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
webpackAsyncContext.keys = ${runtimeTemplate.returningFunction('Object.keys(map)')};
|
|
542
|
+
webpackAsyncContext.resolve = webpackAsyncContextResolve;
|
|
543
|
+
webpackAsyncContext.id = ${JSON.stringify(id)};
|
|
544
|
+
module.exports = webpackAsyncContext;`;
|
|
545
|
+
}
|
|
546
|
+
getEagerSource(dependencies, id, { chunkGraph, runtimeTemplate }) {
|
|
547
|
+
const arrow = runtimeTemplate.supportsArrowFunction();
|
|
548
|
+
const map = this.getUserRequestMap(dependencies, chunkGraph);
|
|
549
|
+
const fakeMap = this.getFakeMap(dependencies, chunkGraph);
|
|
550
|
+
const thenFunction = fakeMap !== 9
|
|
551
|
+
? `${arrow ? 'id =>' : 'function(id)'} {
|
|
552
|
+
${this.getReturnModuleObjectSource(fakeMap)}
|
|
553
|
+
}`
|
|
554
|
+
: RuntimeGlobals.require;
|
|
555
|
+
return `var map = ${JSON.stringify(map, null, '\t')};
|
|
556
|
+
${this.getFakeMapInitStatement(fakeMap)}
|
|
557
|
+
|
|
558
|
+
function webpackAsyncContext(req) {
|
|
559
|
+
return webpackAsyncContextResolve(req).then(${thenFunction});
|
|
560
|
+
}
|
|
561
|
+
function webpackAsyncContextResolve(req) {
|
|
562
|
+
// Here Promise.resolve().then() is used instead of new Promise() to prevent
|
|
563
|
+
// uncaught exception popping up in devtools
|
|
564
|
+
return Promise.resolve().then(${arrow ? '() =>' : 'function()'} {
|
|
565
|
+
if(!${RuntimeGlobals.hasOwnProperty}(map, req)) {
|
|
566
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
567
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
568
|
+
throw e;
|
|
569
|
+
}
|
|
570
|
+
return map[req];
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
webpackAsyncContext.keys = ${runtimeTemplate.returningFunction('Object.keys(map)')};
|
|
574
|
+
webpackAsyncContext.resolve = webpackAsyncContextResolve;
|
|
575
|
+
webpackAsyncContext.id = ${JSON.stringify(id)};
|
|
576
|
+
module.exports = webpackAsyncContext;`;
|
|
577
|
+
}
|
|
578
|
+
getLazyOnceSource(block, dependencies, id, { runtimeTemplate, chunkGraph }) {
|
|
579
|
+
const promise = runtimeTemplate.blockPromise({
|
|
580
|
+
chunkGraph,
|
|
581
|
+
block,
|
|
582
|
+
message: 'lazy-once context',
|
|
583
|
+
runtimeRequirements: new Set(),
|
|
584
|
+
});
|
|
585
|
+
const arrow = runtimeTemplate.supportsArrowFunction();
|
|
586
|
+
const map = this.getUserRequestMap(dependencies, chunkGraph);
|
|
587
|
+
const fakeMap = this.getFakeMap(dependencies, chunkGraph);
|
|
588
|
+
const thenFunction = fakeMap !== 9
|
|
589
|
+
? `${arrow ? 'id =>' : 'function(id)'} {
|
|
590
|
+
${this.getReturnModuleObjectSource(fakeMap, true)};
|
|
591
|
+
}`
|
|
592
|
+
: RuntimeGlobals.require;
|
|
593
|
+
return `var map = ${JSON.stringify(map, null, '\t')};
|
|
594
|
+
${this.getFakeMapInitStatement(fakeMap)}
|
|
595
|
+
|
|
596
|
+
function webpackAsyncContext(req) {
|
|
597
|
+
return webpackAsyncContextResolve(req).then(${thenFunction});
|
|
598
|
+
}
|
|
599
|
+
function webpackAsyncContextResolve(req) {
|
|
600
|
+
return ${promise}.then(${arrow ? '() =>' : 'function()'} {
|
|
601
|
+
if(!${RuntimeGlobals.hasOwnProperty}(map, req)) {
|
|
602
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
603
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
604
|
+
throw e;
|
|
605
|
+
}
|
|
606
|
+
return map[req];
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
webpackAsyncContext.keys = ${runtimeTemplate.returningFunction('Object.keys(map)')};
|
|
610
|
+
webpackAsyncContext.resolve = webpackAsyncContextResolve;
|
|
611
|
+
webpackAsyncContext.id = ${JSON.stringify(id)};
|
|
612
|
+
module.exports = webpackAsyncContext;`;
|
|
613
|
+
}
|
|
614
|
+
getLazySource(blocks, id, { chunkGraph, runtimeTemplate }) {
|
|
615
|
+
const moduleGraph = chunkGraph.moduleGraph;
|
|
616
|
+
const arrow = runtimeTemplate.supportsArrowFunction();
|
|
617
|
+
let hasMultipleOrNoChunks = false;
|
|
618
|
+
let hasNoChunk = true;
|
|
619
|
+
const fakeMap = this.getFakeMap(blocks.map(b => b.dependencies[0]), chunkGraph);
|
|
620
|
+
const hasFakeMap = typeof fakeMap === 'object';
|
|
621
|
+
const items = blocks
|
|
622
|
+
.map(block => {
|
|
623
|
+
const dependency = block.dependencies[0];
|
|
624
|
+
return {
|
|
625
|
+
dependency,
|
|
626
|
+
module: moduleGraph.getModule(dependency),
|
|
627
|
+
block,
|
|
628
|
+
userRequest: dependency.userRequest,
|
|
629
|
+
chunks: undefined,
|
|
630
|
+
};
|
|
631
|
+
})
|
|
632
|
+
.filter(item => item.module);
|
|
633
|
+
for (const item of items) {
|
|
634
|
+
const chunkGroup = chunkGraph.getBlockChunkGroup(item.block);
|
|
635
|
+
const chunks = (chunkGroup === null || chunkGroup === void 0 ? void 0 : chunkGroup.chunks) || [];
|
|
636
|
+
item.chunks = chunks;
|
|
637
|
+
if (chunks.length > 0) {
|
|
638
|
+
hasNoChunk = false;
|
|
639
|
+
}
|
|
640
|
+
if (chunks.length !== 1) {
|
|
641
|
+
hasMultipleOrNoChunks = true;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
const shortMode = hasNoChunk && !hasFakeMap;
|
|
645
|
+
const sortedItems = items.sort((a, b) => {
|
|
646
|
+
if (a.userRequest === b.userRequest)
|
|
647
|
+
return 0;
|
|
648
|
+
return a.userRequest < b.userRequest ? -1 : 1;
|
|
649
|
+
});
|
|
650
|
+
const map = Object.create(null);
|
|
651
|
+
for (const item of sortedItems) {
|
|
652
|
+
const moduleId = chunkGraph.getModuleId(item.module);
|
|
653
|
+
if (shortMode) {
|
|
654
|
+
map[item.userRequest] = moduleId;
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
const arrayStart = [moduleId];
|
|
658
|
+
if (hasFakeMap) {
|
|
659
|
+
arrayStart.push(fakeMap[moduleId]);
|
|
660
|
+
}
|
|
661
|
+
map[item.userRequest] = arrayStart.concat(item.chunks.map(chunk => chunk.id));
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
const chunksStartPosition = hasFakeMap ? 2 : 1;
|
|
665
|
+
const requestPrefix = hasNoChunk
|
|
666
|
+
? 'Promise.resolve()'
|
|
667
|
+
: hasMultipleOrNoChunks
|
|
668
|
+
? `Promise.all(ids.slice(${chunksStartPosition}).map(${RuntimeGlobals.ensureChunk}))`
|
|
669
|
+
: `${RuntimeGlobals.ensureChunk}(ids[${chunksStartPosition}])`;
|
|
670
|
+
const returnModuleObject = this.getReturnModuleObjectSource(fakeMap, true, shortMode ? 'invalid' : 'ids[1]');
|
|
671
|
+
const webpackAsyncContext = requestPrefix === 'Promise.resolve()'
|
|
672
|
+
? `
|
|
673
|
+
function webpackAsyncContext(req) {
|
|
674
|
+
return Promise.resolve().then(${arrow ? '() =>' : 'function()'} {
|
|
675
|
+
if(!${RuntimeGlobals.hasOwnProperty}(map, req)) {
|
|
676
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
677
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
678
|
+
throw e;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
${shortMode ? 'var id = map[req];' : 'var ids = map[req], id = ids[0];'}
|
|
682
|
+
${returnModuleObject}
|
|
683
|
+
});
|
|
684
|
+
}`
|
|
685
|
+
: `function webpackAsyncContext(req) {
|
|
686
|
+
if(!${RuntimeGlobals.hasOwnProperty}(map, req)) {
|
|
687
|
+
return Promise.resolve().then(${arrow ? '() =>' : 'function()'} {
|
|
688
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
689
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
690
|
+
throw e;
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
var ids = map[req], id = ids[0];
|
|
695
|
+
return ${requestPrefix}.then(${arrow ? '() =>' : 'function()'} {
|
|
696
|
+
${returnModuleObject}
|
|
697
|
+
});
|
|
698
|
+
}`;
|
|
699
|
+
return `var map = ${JSON.stringify(map, null, '\t')};
|
|
700
|
+
${webpackAsyncContext}
|
|
701
|
+
webpackAsyncContext.keys = ${runtimeTemplate.returningFunction('Object.keys(map)')};
|
|
702
|
+
webpackAsyncContext.id = ${JSON.stringify(id)};
|
|
703
|
+
module.exports = webpackAsyncContext;`;
|
|
704
|
+
}
|
|
705
|
+
getSourceForEmptyContext(id, runtimeTemplate) {
|
|
706
|
+
return `function webpackEmptyContext(req) {
|
|
707
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
708
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
709
|
+
throw e;
|
|
710
|
+
}
|
|
711
|
+
webpackEmptyContext.keys = ${runtimeTemplate.returningFunction('[]')};
|
|
712
|
+
webpackEmptyContext.resolve = webpackEmptyContext;
|
|
713
|
+
webpackEmptyContext.id = ${JSON.stringify(id)};
|
|
714
|
+
module.exports = webpackEmptyContext;`;
|
|
715
|
+
}
|
|
716
|
+
getSourceForEmptyAsyncContext(id, runtimeTemplate) {
|
|
717
|
+
const arrow = runtimeTemplate.supportsArrowFunction();
|
|
718
|
+
return `function webpackEmptyAsyncContext(req) {
|
|
719
|
+
// Here Promise.resolve().then() is used instead of new Promise() to prevent
|
|
720
|
+
// uncaught exception popping up in devtools
|
|
721
|
+
return Promise.resolve().then(${arrow ? '() =>' : 'function()'} {
|
|
722
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
723
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
724
|
+
throw e;
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
webpackEmptyAsyncContext.keys = ${runtimeTemplate.returningFunction('[]')};
|
|
728
|
+
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
|
|
729
|
+
webpackEmptyAsyncContext.id = ${JSON.stringify(id)};
|
|
730
|
+
module.exports = webpackEmptyAsyncContext;`;
|
|
731
|
+
}
|
|
732
|
+
getSourceString(asyncMode, { runtimeTemplate, chunkGraph }) {
|
|
733
|
+
const id = chunkGraph.getModuleId(this);
|
|
734
|
+
if (asyncMode === 'lazy') {
|
|
735
|
+
if (this.blocks && this.blocks.length > 0) {
|
|
736
|
+
return this.getLazySource(this.blocks, id, {
|
|
737
|
+
runtimeTemplate,
|
|
738
|
+
chunkGraph,
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
return this.getSourceForEmptyAsyncContext(id, runtimeTemplate);
|
|
742
|
+
}
|
|
743
|
+
if (asyncMode === 'eager') {
|
|
744
|
+
if (this.dependencies && this.dependencies.length > 0) {
|
|
745
|
+
return this.getEagerSource(this.dependencies, id, {
|
|
746
|
+
chunkGraph,
|
|
747
|
+
runtimeTemplate,
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
return this.getSourceForEmptyAsyncContext(id, runtimeTemplate);
|
|
751
|
+
}
|
|
752
|
+
if (asyncMode === 'lazy-once') {
|
|
753
|
+
const block = this.blocks[0];
|
|
754
|
+
if (block) {
|
|
755
|
+
return this.getLazyOnceSource(block, block.dependencies, id, {
|
|
756
|
+
runtimeTemplate,
|
|
757
|
+
chunkGraph,
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
return this.getSourceForEmptyAsyncContext(id, runtimeTemplate);
|
|
761
|
+
}
|
|
762
|
+
if (asyncMode === 'async-weak') {
|
|
763
|
+
if (this.dependencies && this.dependencies.length > 0) {
|
|
764
|
+
return this.getAsyncWeakSource(this.dependencies, id, {
|
|
765
|
+
chunkGraph,
|
|
766
|
+
runtimeTemplate,
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
return this.getSourceForEmptyAsyncContext(id, runtimeTemplate);
|
|
770
|
+
}
|
|
771
|
+
if (asyncMode === 'weak') {
|
|
772
|
+
if (this.dependencies && this.dependencies.length > 0) {
|
|
773
|
+
return this.getWeakSyncSource(this.dependencies, id, chunkGraph);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
if (this.dependencies && this.dependencies.length > 0) {
|
|
777
|
+
return this.getSyncSource(this.dependencies, id, chunkGraph);
|
|
778
|
+
}
|
|
779
|
+
return this.getSourceForEmptyContext(id, runtimeTemplate);
|
|
780
|
+
}
|
|
781
|
+
getSource(sourceString, compilation) {
|
|
782
|
+
if (this.useSourceMap || this.useSimpleSourceMap) {
|
|
783
|
+
return new webpack_sources_1.OriginalSource(sourceString, `webpack://${(0, identifier_1.makePathsRelative)((compilation === null || compilation === void 0 ? void 0 : compilation.compiler.context) || '', this.identifier(), compilation === null || compilation === void 0 ? void 0 : compilation.compiler.root)}`);
|
|
784
|
+
}
|
|
785
|
+
return new webpack_sources_1.RawSource(sourceString);
|
|
786
|
+
}
|
|
787
|
+
codeGeneration(context) {
|
|
788
|
+
const { chunkGraph, compilation } = context;
|
|
789
|
+
const sources = new Map();
|
|
790
|
+
sources.set('javascript', this.getSource(this.getSourceString(this.options.mode, context), compilation));
|
|
791
|
+
const set = new Set();
|
|
792
|
+
const allDeps = this.dependencies.length > 0 ? this.dependencies.slice() : [];
|
|
793
|
+
for (const block of this.blocks)
|
|
794
|
+
for (const dep of block.dependencies)
|
|
795
|
+
allDeps.push(dep);
|
|
796
|
+
set.add(RuntimeGlobals.module);
|
|
797
|
+
set.add(RuntimeGlobals.hasOwnProperty);
|
|
798
|
+
if (allDeps.length > 0) {
|
|
799
|
+
const asyncMode = this.options.mode;
|
|
800
|
+
set.add(RuntimeGlobals.require);
|
|
801
|
+
if (asyncMode === 'weak') {
|
|
802
|
+
set.add(RuntimeGlobals.moduleFactories);
|
|
803
|
+
}
|
|
804
|
+
else if (asyncMode === 'async-weak') {
|
|
805
|
+
set.add(RuntimeGlobals.moduleFactories);
|
|
806
|
+
set.add(RuntimeGlobals.ensureChunk);
|
|
807
|
+
}
|
|
808
|
+
else if (asyncMode === 'lazy' || asyncMode === 'lazy-once') {
|
|
809
|
+
set.add(RuntimeGlobals.ensureChunk);
|
|
810
|
+
}
|
|
811
|
+
if (this.getFakeMap(allDeps, chunkGraph) !== 9) {
|
|
812
|
+
set.add(RuntimeGlobals.createFakeNamespaceObject);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
return {
|
|
816
|
+
sources,
|
|
817
|
+
runtimeRequirements: set,
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
size(type) {
|
|
821
|
+
// base penalty
|
|
822
|
+
let size = 160;
|
|
823
|
+
// if we don't have dependencies we stop here.
|
|
824
|
+
for (const dependency of this.dependencies) {
|
|
825
|
+
const element = dependency;
|
|
826
|
+
size += 5 + element.userRequest.length;
|
|
827
|
+
}
|
|
828
|
+
return size;
|
|
829
|
+
}
|
|
830
|
+
serialize(context) {
|
|
831
|
+
const { write } = context;
|
|
832
|
+
write(this._identifier);
|
|
833
|
+
write(this._forceBuild);
|
|
834
|
+
super.serialize(context);
|
|
835
|
+
}
|
|
836
|
+
deserialize(context) {
|
|
837
|
+
const { read } = context;
|
|
838
|
+
this._identifier = read();
|
|
839
|
+
this._forceBuild = read();
|
|
840
|
+
super.deserialize(context);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
(0, makeSerializable_1.default)(ContextModule, 'mp-compiler/core/module/ContextModule');
|
|
844
|
+
exports.default = ContextModule;
|