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,821 @@
|
|
|
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
|
+
exports.JavascriptModulesPlugin = exports.chunkHasJs = void 0;
|
|
30
|
+
const tapable_1 = require("tapable");
|
|
31
|
+
const vm_1 = __importDefault(require("vm"));
|
|
32
|
+
const webpack_sources_1 = require("webpack-sources");
|
|
33
|
+
const Compilation_1 = __importDefault(require("@/Compilation"));
|
|
34
|
+
const HookBaseError_1 = require("@/base/errors/HookBaseError");
|
|
35
|
+
const InitFragment_1 = __importDefault(require("@/base/InitFragment"));
|
|
36
|
+
const ModuleTypeConstants_1 = require("@/module/ModuleTypeConstants");
|
|
37
|
+
const RuntimeGlobals = __importStar(require("@/module/RuntimeGlobals"));
|
|
38
|
+
const Template_1 = require("@/template/Template");
|
|
39
|
+
const IterableHelpers_1 = require("@/base/IterableHelpers");
|
|
40
|
+
const StringXor_1 = __importDefault(require("@/base/StringXor"));
|
|
41
|
+
const comparators_1 = require("@/base/comparators");
|
|
42
|
+
const createHash_1 = __importDefault(require("@/base/createHash"));
|
|
43
|
+
const nonNumericOnlyHash_1 = __importDefault(require("@/base/nonNumericOnlyHash"));
|
|
44
|
+
const RuntimeHelpers_1 = require("@/module/RuntimeHelpers");
|
|
45
|
+
const JavascriptGenerator_1 = __importDefault(require("@/module/javascript/JavascriptGenerator"));
|
|
46
|
+
const JavascriptParser_1 = require("@/module/javascript/JavascriptParser");
|
|
47
|
+
const chunkHasJs = (chunk, chunkGraph) => {
|
|
48
|
+
if (chunkGraph.getNumberOfEntryModules(chunk) > 0)
|
|
49
|
+
return true;
|
|
50
|
+
return !!chunkGraph.getChunkModulesIterableBySourceType(chunk, 'javascript');
|
|
51
|
+
};
|
|
52
|
+
exports.chunkHasJs = chunkHasJs;
|
|
53
|
+
const printGeneratedCodeForStack = (module, code) => {
|
|
54
|
+
const lines = code.split('\n');
|
|
55
|
+
const n = `${lines.length}`.length;
|
|
56
|
+
return `\n\nGenerated code for ${module.identifier()}\n${lines
|
|
57
|
+
.map((line, i, lines) => {
|
|
58
|
+
const iStr = `${i + 1}`;
|
|
59
|
+
return `${' '.repeat(n - iStr.length)}${iStr} | ${line}`;
|
|
60
|
+
})
|
|
61
|
+
.join('\n')}`;
|
|
62
|
+
};
|
|
63
|
+
const compilationHooksMap = new WeakMap();
|
|
64
|
+
const PLUGIN_NAME = 'JavascriptModulesPlugin';
|
|
65
|
+
class JavascriptModulesPlugin {
|
|
66
|
+
static getCompilationHooks(compilation) {
|
|
67
|
+
if (!(compilation instanceof Compilation_1.default)) {
|
|
68
|
+
throw new TypeError("The 'compilation' argument must be an instance of Compilation");
|
|
69
|
+
}
|
|
70
|
+
let hooks = compilationHooksMap.get(compilation);
|
|
71
|
+
if (hooks === undefined) {
|
|
72
|
+
hooks = {
|
|
73
|
+
renderModuleContent: new tapable_1.SyncWaterfallHook(['source', 'module', 'renderContext']),
|
|
74
|
+
renderModuleContainer: new tapable_1.SyncWaterfallHook([
|
|
75
|
+
'source',
|
|
76
|
+
'module',
|
|
77
|
+
'renderContext',
|
|
78
|
+
]),
|
|
79
|
+
renderModulePackage: new tapable_1.SyncWaterfallHook(['source', 'module', 'renderContext']),
|
|
80
|
+
render: new tapable_1.SyncWaterfallHook(['source', 'renderContext']),
|
|
81
|
+
renderContent: new tapable_1.SyncWaterfallHook(['source', 'renderContext']),
|
|
82
|
+
renderStartup: new tapable_1.SyncWaterfallHook([
|
|
83
|
+
'source',
|
|
84
|
+
'module',
|
|
85
|
+
'startupRenderContext',
|
|
86
|
+
]),
|
|
87
|
+
renderChunk: new tapable_1.SyncWaterfallHook(['source', 'renderContext']),
|
|
88
|
+
renderMain: new tapable_1.SyncWaterfallHook(['source', 'renderContext']),
|
|
89
|
+
renderRequire: new tapable_1.SyncWaterfallHook(['code', 'renderContext']),
|
|
90
|
+
inlineInRuntimeBailout: new tapable_1.SyncBailHook(['module', 'renderContext']),
|
|
91
|
+
embedInRuntimeBailout: new tapable_1.SyncBailHook(['module', 'renderContext']),
|
|
92
|
+
strictRuntimeBailout: new tapable_1.SyncBailHook(['renderContext']),
|
|
93
|
+
chunkHash: new tapable_1.SyncHook(['chunk', 'hash', 'context']),
|
|
94
|
+
useSourceMap: new tapable_1.SyncBailHook(['chunk', 'renderContext']),
|
|
95
|
+
};
|
|
96
|
+
compilationHooksMap.set(compilation, hooks);
|
|
97
|
+
}
|
|
98
|
+
return hooks;
|
|
99
|
+
}
|
|
100
|
+
constructor(options = {}) {
|
|
101
|
+
this.options = options;
|
|
102
|
+
this._moduleFactoryCache = new WeakMap();
|
|
103
|
+
}
|
|
104
|
+
apply(compiler) {
|
|
105
|
+
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation, { normalModuleFactory }) => {
|
|
106
|
+
const hooks = JavascriptModulesPlugin.getCompilationHooks(compilation);
|
|
107
|
+
normalModuleFactory.hooks.createParser
|
|
108
|
+
.for(ModuleTypeConstants_1.JAVASCRIPT_MODULE_TYPE_AUTO)
|
|
109
|
+
.tap(PLUGIN_NAME, options => new JavascriptParser_1.JavascriptParser('auto'));
|
|
110
|
+
normalModuleFactory.hooks.createParser
|
|
111
|
+
.for(ModuleTypeConstants_1.JAVASCRIPT_MODULE_TYPE_DYNAMIC)
|
|
112
|
+
.tap(PLUGIN_NAME, options => new JavascriptParser_1.JavascriptParser('script'));
|
|
113
|
+
normalModuleFactory.hooks.createParser
|
|
114
|
+
.for(ModuleTypeConstants_1.JAVASCRIPT_MODULE_TYPE_ESM)
|
|
115
|
+
.tap(PLUGIN_NAME, options => new JavascriptParser_1.JavascriptParser('module'));
|
|
116
|
+
normalModuleFactory.hooks.createGenerator
|
|
117
|
+
.for(ModuleTypeConstants_1.JAVASCRIPT_MODULE_TYPE_AUTO)
|
|
118
|
+
.tap(PLUGIN_NAME, () => new JavascriptGenerator_1.default());
|
|
119
|
+
normalModuleFactory.hooks.createGenerator
|
|
120
|
+
.for(ModuleTypeConstants_1.JAVASCRIPT_MODULE_TYPE_DYNAMIC)
|
|
121
|
+
.tap(PLUGIN_NAME, () => new JavascriptGenerator_1.default());
|
|
122
|
+
normalModuleFactory.hooks.createGenerator
|
|
123
|
+
.for(ModuleTypeConstants_1.JAVASCRIPT_MODULE_TYPE_ESM)
|
|
124
|
+
.tap(PLUGIN_NAME, () => new JavascriptGenerator_1.default());
|
|
125
|
+
compilation.hooks.renderManifest.tap(PLUGIN_NAME, (result, options) => {
|
|
126
|
+
const { hash, chunk, chunkGraph, moduleGraph, runtimeTemplate, dependencyTemplates, outputOptions, codeGenerationResults, } = options;
|
|
127
|
+
let render;
|
|
128
|
+
const filenameTemplate = JavascriptModulesPlugin.getChunkFilenameTemplate(chunk, outputOptions);
|
|
129
|
+
if (chunk.hasRuntime()) {
|
|
130
|
+
render = () => this.renderMain({
|
|
131
|
+
hash,
|
|
132
|
+
chunk,
|
|
133
|
+
dependencyTemplates,
|
|
134
|
+
runtimeTemplate,
|
|
135
|
+
moduleGraph,
|
|
136
|
+
chunkGraph,
|
|
137
|
+
codeGenerationResults,
|
|
138
|
+
strictMode: runtimeTemplate.isModule(),
|
|
139
|
+
}, hooks, compilation);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
if (!chunkHasJs(chunk, chunkGraph)) {
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
render = () => this.renderChunk({
|
|
146
|
+
chunk,
|
|
147
|
+
dependencyTemplates,
|
|
148
|
+
runtimeTemplate,
|
|
149
|
+
moduleGraph,
|
|
150
|
+
chunkGraph,
|
|
151
|
+
codeGenerationResults,
|
|
152
|
+
strictMode: runtimeTemplate.isModule(),
|
|
153
|
+
}, hooks);
|
|
154
|
+
}
|
|
155
|
+
result.push({
|
|
156
|
+
render,
|
|
157
|
+
filenameTemplate,
|
|
158
|
+
pathOptions: {
|
|
159
|
+
hash,
|
|
160
|
+
runtime: chunk.runtime,
|
|
161
|
+
chunk,
|
|
162
|
+
contentHashType: 'javascript',
|
|
163
|
+
},
|
|
164
|
+
info: {
|
|
165
|
+
javascriptModule: compilation.runtimeTemplate.isModule(),
|
|
166
|
+
},
|
|
167
|
+
identifier: `chunk${chunk.id}`,
|
|
168
|
+
hash: chunk.contentHash.javascript,
|
|
169
|
+
});
|
|
170
|
+
return result;
|
|
171
|
+
});
|
|
172
|
+
compilation.hooks.chunkHash.tap(PLUGIN_NAME, (chunk, hash, context) => {
|
|
173
|
+
hooks.chunkHash.call(chunk, hash, context);
|
|
174
|
+
if (chunk.hasRuntime()) {
|
|
175
|
+
this.updateHashWithBootstrap(hash, {
|
|
176
|
+
hash: '0000',
|
|
177
|
+
chunk,
|
|
178
|
+
codeGenerationResults: context.codeGenerationResults,
|
|
179
|
+
chunkGraph: context.chunkGraph,
|
|
180
|
+
moduleGraph: context.moduleGraph,
|
|
181
|
+
runtimeTemplate: context.runtimeTemplate,
|
|
182
|
+
}, hooks);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
compilation.hooks.contentHash.tap(PLUGIN_NAME, chunk => {
|
|
186
|
+
const { chunkGraph, codeGenerationResults, moduleGraph, runtimeTemplate, outputOptions: { hashSalt, hashDigest, hashDigestLength, hashFunction }, } = compilation;
|
|
187
|
+
const hash = (0, createHash_1.default)(hashFunction);
|
|
188
|
+
if (hashSalt)
|
|
189
|
+
hash.update(hashSalt);
|
|
190
|
+
if (chunk.hasRuntime()) {
|
|
191
|
+
this.updateHashWithBootstrap(hash, {
|
|
192
|
+
hash: '0000',
|
|
193
|
+
chunk,
|
|
194
|
+
codeGenerationResults,
|
|
195
|
+
chunkGraph: compilation.chunkGraph,
|
|
196
|
+
moduleGraph: compilation.moduleGraph,
|
|
197
|
+
runtimeTemplate: compilation.runtimeTemplate,
|
|
198
|
+
}, hooks);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
hash.update(`${chunk.id} `);
|
|
202
|
+
hash.update(chunk.ids ? chunk.ids.join(',') : '');
|
|
203
|
+
}
|
|
204
|
+
hooks.chunkHash.call(chunk, hash, {
|
|
205
|
+
chunkGraph,
|
|
206
|
+
codeGenerationResults,
|
|
207
|
+
moduleGraph,
|
|
208
|
+
runtimeTemplate,
|
|
209
|
+
});
|
|
210
|
+
const modules = chunkGraph.getChunkModulesIterableBySourceType(chunk, 'javascript');
|
|
211
|
+
if (modules) {
|
|
212
|
+
const xor = new StringXor_1.default();
|
|
213
|
+
for (const m of modules) {
|
|
214
|
+
xor.add(chunkGraph.getModuleHash(m, chunk.runtime));
|
|
215
|
+
}
|
|
216
|
+
xor.updateHash(hash);
|
|
217
|
+
}
|
|
218
|
+
const runtimeModules = chunkGraph.getChunkModulesIterableBySourceType(chunk, ModuleTypeConstants_1.WEBPACK_MODULE_TYPE_RUNTIME);
|
|
219
|
+
if (runtimeModules) {
|
|
220
|
+
const xor = new StringXor_1.default();
|
|
221
|
+
for (const m of runtimeModules) {
|
|
222
|
+
xor.add(chunkGraph.getModuleHash(m, chunk.runtime));
|
|
223
|
+
}
|
|
224
|
+
xor.updateHash(hash);
|
|
225
|
+
}
|
|
226
|
+
const digest = hash.digest(hashDigest);
|
|
227
|
+
chunk.contentHash.javascript = (0, nonNumericOnlyHash_1.default)(digest, hashDigestLength);
|
|
228
|
+
});
|
|
229
|
+
compilation.hooks.additionalTreeRuntimeRequirements.tap(PLUGIN_NAME, (chunk, set, { chunkGraph }) => {
|
|
230
|
+
if (!set.has(RuntimeGlobals.startupNoDefault) &&
|
|
231
|
+
chunkGraph.hasChunkEntryDependentChunks(chunk)) {
|
|
232
|
+
set.add(RuntimeGlobals.onChunksLoaded);
|
|
233
|
+
set.add(RuntimeGlobals.require);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
compilation.hooks.executeModule.tap(PLUGIN_NAME, (options, context) => {
|
|
237
|
+
const source = options.codeGenerationResult.sources.get('javascript');
|
|
238
|
+
if (source === undefined)
|
|
239
|
+
return;
|
|
240
|
+
const { module, moduleObject } = options;
|
|
241
|
+
const code = source.source();
|
|
242
|
+
const fn = vm_1.default.runInThisContext(`(function(${module.moduleArgument}, ${module.exportsArgument}, ${RuntimeGlobals.require}) {\n${code}\n/**/})`, {
|
|
243
|
+
filename: module.identifier(),
|
|
244
|
+
lineOffset: -1,
|
|
245
|
+
});
|
|
246
|
+
try {
|
|
247
|
+
fn.call(moduleObject.exports, moduleObject, moduleObject.exports, context.__webpack_require__);
|
|
248
|
+
}
|
|
249
|
+
catch (e) {
|
|
250
|
+
e.stack += printGeneratedCodeForStack(options.module, code);
|
|
251
|
+
throw e;
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
compilation.hooks.executeModule.tap(PLUGIN_NAME, (options, context) => {
|
|
255
|
+
const source = options.codeGenerationResult.sources.get('runtime');
|
|
256
|
+
if (source === undefined)
|
|
257
|
+
return;
|
|
258
|
+
let code = source.source();
|
|
259
|
+
if (typeof code !== 'string')
|
|
260
|
+
code = code.toString();
|
|
261
|
+
const fn = vm_1.default.runInThisContext(`(function(${RuntimeGlobals.require}) {\n${code}\n/**/})`, {
|
|
262
|
+
filename: options.module.identifier(),
|
|
263
|
+
lineOffset: -1,
|
|
264
|
+
});
|
|
265
|
+
try {
|
|
266
|
+
fn.call(null, context.__webpack_require__);
|
|
267
|
+
}
|
|
268
|
+
catch (e) {
|
|
269
|
+
e.stack += printGeneratedCodeForStack(options.module, code);
|
|
270
|
+
throw e;
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
static getChunkFilenameTemplate(chunk, outputOptions) {
|
|
276
|
+
if (chunk.filenameTemplate) {
|
|
277
|
+
return chunk.filenameTemplate;
|
|
278
|
+
}
|
|
279
|
+
if (chunk.canBeInitial()) {
|
|
280
|
+
return outputOptions.filename;
|
|
281
|
+
}
|
|
282
|
+
return outputOptions.chunkFilename;
|
|
283
|
+
}
|
|
284
|
+
renderModule(module, renderContext, hooks, factory) {
|
|
285
|
+
const { chunk, chunkGraph, runtimeTemplate, codeGenerationResults, strictMode } = renderContext;
|
|
286
|
+
try {
|
|
287
|
+
const codeGenResult = codeGenerationResults.get(module, chunk.runtime);
|
|
288
|
+
const moduleSource = codeGenResult.sources.get('javascript');
|
|
289
|
+
if (!moduleSource)
|
|
290
|
+
return null;
|
|
291
|
+
if (codeGenResult.data !== undefined) {
|
|
292
|
+
const chunkInitFragments = codeGenResult.data.get('chunkInitFragments');
|
|
293
|
+
if (chunkInitFragments) {
|
|
294
|
+
for (const i of chunkInitFragments)
|
|
295
|
+
renderContext.chunkInitFragments.push(i);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
const moduleSourcePostContent = (0, HookBaseError_1.tryRunOrBaseError)(() => hooks.renderModuleContent.call(moduleSource, module, renderContext), 'JavascriptModulesPlugin.getCompilationHooks().renderModuleContent');
|
|
299
|
+
let moduleSourcePostContainer;
|
|
300
|
+
if (factory) {
|
|
301
|
+
const runtimeRequirements = chunkGraph.getModuleRuntimeRequirements(module, chunk.runtime);
|
|
302
|
+
const needModule = runtimeRequirements.has(RuntimeGlobals.module);
|
|
303
|
+
const needExports = runtimeRequirements.has(RuntimeGlobals.exports);
|
|
304
|
+
const needRequire = runtimeRequirements.has(RuntimeGlobals.require) ||
|
|
305
|
+
runtimeRequirements.has(RuntimeGlobals.requireScope);
|
|
306
|
+
const needThisAsExports = runtimeRequirements.has(RuntimeGlobals.thisAsExports);
|
|
307
|
+
const needStrict = module.buildInfo.strict && !strictMode;
|
|
308
|
+
const cacheEntry = this._moduleFactoryCache.get(moduleSourcePostContent);
|
|
309
|
+
let source;
|
|
310
|
+
if (cacheEntry &&
|
|
311
|
+
cacheEntry.needModule === needModule &&
|
|
312
|
+
cacheEntry.needExports === needExports &&
|
|
313
|
+
cacheEntry.needRequire === needRequire &&
|
|
314
|
+
cacheEntry.needThisAsExports === needThisAsExports &&
|
|
315
|
+
cacheEntry.needStrict === needStrict) {
|
|
316
|
+
source = cacheEntry.source;
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
const factorySource = new webpack_sources_1.ConcatSource();
|
|
320
|
+
const args = [];
|
|
321
|
+
if (needExports || needRequire || needModule)
|
|
322
|
+
args.push(needModule ? module.moduleArgument : `__unused_webpack_${module.moduleArgument}`);
|
|
323
|
+
if (needExports || needRequire)
|
|
324
|
+
args.push(needExports ? module.exportsArgument : `__unused_webpack_${module.exportsArgument}`);
|
|
325
|
+
if (needRequire)
|
|
326
|
+
args.push(RuntimeGlobals.require);
|
|
327
|
+
if (!needThisAsExports && runtimeTemplate.supportsArrowFunction()) {
|
|
328
|
+
factorySource.add(`/***/ ((${args.join(', ')}) => {\n\n`);
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
factorySource.add(`/***/ (function(${args.join(', ')}) {\n\n`);
|
|
332
|
+
}
|
|
333
|
+
if (needStrict) {
|
|
334
|
+
factorySource.add('"use strict";\n');
|
|
335
|
+
}
|
|
336
|
+
factorySource.add(moduleSourcePostContent);
|
|
337
|
+
factorySource.add('\n\n/***/ })');
|
|
338
|
+
source = new webpack_sources_1.CachedSource(factorySource);
|
|
339
|
+
this._moduleFactoryCache.set(moduleSourcePostContent, {
|
|
340
|
+
source,
|
|
341
|
+
needModule,
|
|
342
|
+
needExports,
|
|
343
|
+
needRequire,
|
|
344
|
+
needThisAsExports,
|
|
345
|
+
needStrict,
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
moduleSourcePostContainer = (0, HookBaseError_1.tryRunOrBaseError)(() => hooks.renderModuleContainer.call(source, module, renderContext), 'JavascriptModulesPlugin.getCompilationHooks().renderModuleContainer');
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
moduleSourcePostContainer = moduleSourcePostContent;
|
|
352
|
+
}
|
|
353
|
+
return (0, HookBaseError_1.tryRunOrBaseError)(() => hooks.renderModulePackage.call(moduleSourcePostContainer, module, renderContext), 'JavascriptModulesPlugin.getCompilationHooks().renderModulePackage');
|
|
354
|
+
}
|
|
355
|
+
catch (e) {
|
|
356
|
+
e.module = module;
|
|
357
|
+
throw e;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
renderChunk(renderContext, hooks) {
|
|
361
|
+
const { chunk, chunkGraph } = renderContext;
|
|
362
|
+
const modules = chunkGraph.getOrderedChunkModulesIterableBySourceType(chunk, 'javascript', comparators_1.compareModulesByIdentifier);
|
|
363
|
+
const allModules = modules ? Array.from(modules) : [];
|
|
364
|
+
let strictHeader;
|
|
365
|
+
let allStrict = renderContext.strictMode;
|
|
366
|
+
if (!allStrict && allModules.every(m => m.buildInfo.strict)) {
|
|
367
|
+
const strictBailout = hooks.strictRuntimeBailout.call(renderContext);
|
|
368
|
+
strictHeader = strictBailout
|
|
369
|
+
? `// runtime can't be in strict mode because ${strictBailout}.\n`
|
|
370
|
+
: '"use strict";\n';
|
|
371
|
+
if (!strictBailout)
|
|
372
|
+
allStrict = true;
|
|
373
|
+
}
|
|
374
|
+
const chunkRenderContext = Object.assign(Object.assign({}, renderContext), { chunkInitFragments: [], strictMode: allStrict });
|
|
375
|
+
const moduleSources = Template_1.Template.renderChunkModules(chunkRenderContext, allModules, module => this.renderModule(module, chunkRenderContext, hooks, true)) || new webpack_sources_1.RawSource('{}');
|
|
376
|
+
let source = (0, HookBaseError_1.tryRunOrBaseError)(() => hooks.renderChunk.call(moduleSources, chunkRenderContext), 'JavascriptModulesPlugin.getCompilationHooks().renderChunk');
|
|
377
|
+
source = (0, HookBaseError_1.tryRunOrBaseError)(() => hooks.renderContent.call(source, chunkRenderContext), 'JavascriptModulesPlugin.getCompilationHooks().renderContent');
|
|
378
|
+
if (!source) {
|
|
379
|
+
throw new Error('JavascriptModulesPlugin error: JavascriptModulesPlugin.getCompilationHooks().renderContent plugins should return something');
|
|
380
|
+
}
|
|
381
|
+
source = InitFragment_1.default.addToSource(source, chunkRenderContext.chunkInitFragments, chunkRenderContext);
|
|
382
|
+
source = (0, HookBaseError_1.tryRunOrBaseError)(() => hooks.render.call(source, chunkRenderContext), 'JavascriptModulesPlugin.getCompilationHooks().render');
|
|
383
|
+
if (!source) {
|
|
384
|
+
throw new Error('JavascriptModulesPlugin error: JavascriptModulesPlugin.getCompilationHooks().render plugins should return something');
|
|
385
|
+
}
|
|
386
|
+
chunk.rendered = true;
|
|
387
|
+
return strictHeader
|
|
388
|
+
? new webpack_sources_1.ConcatSource(strictHeader, source, ';')
|
|
389
|
+
: renderContext.runtimeTemplate.isModule()
|
|
390
|
+
? source
|
|
391
|
+
: new webpack_sources_1.ConcatSource(source, ';');
|
|
392
|
+
}
|
|
393
|
+
renderMain(renderContext, hooks, compilation) {
|
|
394
|
+
const { chunk, chunkGraph, runtimeTemplate } = renderContext;
|
|
395
|
+
const runtimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
|
|
396
|
+
const iife = runtimeTemplate.isIIFE();
|
|
397
|
+
const bootstrap = this.renderBootstrap(renderContext, hooks);
|
|
398
|
+
const useSourceMap = hooks.useSourceMap.call(chunk, renderContext);
|
|
399
|
+
const allModules = Array.from(chunkGraph.getOrderedChunkModulesIterableBySourceType(chunk, 'javascript', comparators_1.compareModulesByIdentifier) || []);
|
|
400
|
+
const hasEntryModules = chunkGraph.getNumberOfEntryModules(chunk) > 0;
|
|
401
|
+
let inlinedModules;
|
|
402
|
+
if (bootstrap.allowInlineStartup && hasEntryModules) {
|
|
403
|
+
inlinedModules = new Set(chunkGraph.getChunkEntryModulesIterable(chunk));
|
|
404
|
+
}
|
|
405
|
+
const source = new webpack_sources_1.ConcatSource();
|
|
406
|
+
let prefix;
|
|
407
|
+
if (iife) {
|
|
408
|
+
if (runtimeTemplate.supportsArrowFunction()) {
|
|
409
|
+
source.add('/******/ (() => { // webpackBootstrap\n');
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
source.add('/******/ (function() { // webpackBootstrap\n');
|
|
413
|
+
}
|
|
414
|
+
prefix = '/******/ \t';
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
prefix = '/******/ ';
|
|
418
|
+
}
|
|
419
|
+
let allStrict = renderContext.strictMode;
|
|
420
|
+
if (!allStrict && allModules.every((m) => m.buildInfo.strict)) {
|
|
421
|
+
const strictBailout = hooks.strictRuntimeBailout.call(renderContext);
|
|
422
|
+
if (strictBailout) {
|
|
423
|
+
source.add(`${prefix}// runtime can't be in strict mode because ${strictBailout}.\n`);
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
allStrict = true;
|
|
427
|
+
source.add(`${prefix}"use strict";\n`);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
const chunkRenderContext = Object.assign(Object.assign({}, renderContext), { chunkInitFragments: [], strictMode: allStrict });
|
|
431
|
+
const chunkModules = Template_1.Template.renderChunkModules(chunkRenderContext, (inlinedModules ? allModules.filter(m => !inlinedModules.has(m)) : allModules), module => this.renderModule(module, chunkRenderContext, hooks, true), prefix);
|
|
432
|
+
if (chunkModules ||
|
|
433
|
+
runtimeRequirements.has(RuntimeGlobals.moduleFactories) ||
|
|
434
|
+
runtimeRequirements.has(RuntimeGlobals.moduleFactoriesAddOnly) ||
|
|
435
|
+
runtimeRequirements.has(RuntimeGlobals.require)) {
|
|
436
|
+
source.add(`${prefix}var __webpack_modules__ = (`);
|
|
437
|
+
source.add(chunkModules || '{}');
|
|
438
|
+
source.add(');\n');
|
|
439
|
+
source.add('/************************************************************************/\n');
|
|
440
|
+
}
|
|
441
|
+
if (bootstrap.header.length > 0) {
|
|
442
|
+
const header = `${Template_1.Template.asString(bootstrap.header)}\n`;
|
|
443
|
+
source.add(new webpack_sources_1.PrefixSource(prefix, useSourceMap ? new webpack_sources_1.OriginalSource(header, 'webpack/bootstrap') : new webpack_sources_1.RawSource(header)));
|
|
444
|
+
source.add('/************************************************************************/\n');
|
|
445
|
+
}
|
|
446
|
+
const runtimeModules = renderContext.chunkGraph.getChunkRuntimeModulesInOrder(chunk);
|
|
447
|
+
if (runtimeModules.length > 0) {
|
|
448
|
+
source.add(new webpack_sources_1.PrefixSource(prefix, Template_1.Template.renderRuntimeModules(runtimeModules, chunkRenderContext)));
|
|
449
|
+
source.add('/************************************************************************/\n');
|
|
450
|
+
// runtimeRuntimeModules calls codeGeneration
|
|
451
|
+
for (const module of runtimeModules) {
|
|
452
|
+
compilation.codeGeneratedModules.add(module);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
if (inlinedModules) {
|
|
456
|
+
if (bootstrap.beforeStartup.length > 0) {
|
|
457
|
+
const beforeStartup = `${Template_1.Template.asString(bootstrap.beforeStartup)}\n`;
|
|
458
|
+
source.add(new webpack_sources_1.PrefixSource(prefix, useSourceMap
|
|
459
|
+
? new webpack_sources_1.OriginalSource(beforeStartup, 'webpack/before-startup')
|
|
460
|
+
: new webpack_sources_1.RawSource(beforeStartup)));
|
|
461
|
+
}
|
|
462
|
+
const lastInlinedModule = (0, IterableHelpers_1.last)(inlinedModules);
|
|
463
|
+
const startupSource = new webpack_sources_1.ConcatSource();
|
|
464
|
+
startupSource.add(`var ${RuntimeGlobals.exports} = {};\n`);
|
|
465
|
+
for (const m of inlinedModules) {
|
|
466
|
+
const renderedModule = this.renderModule(m, chunkRenderContext, hooks, false);
|
|
467
|
+
if (renderedModule) {
|
|
468
|
+
const innerStrict = !allStrict && m.buildInfo.strict;
|
|
469
|
+
const runtimeRequirements = chunkGraph.getModuleRuntimeRequirements(m, chunk.runtime);
|
|
470
|
+
const exports = runtimeRequirements.has(RuntimeGlobals.exports);
|
|
471
|
+
const webpackExports = exports && m.exportsArgument === RuntimeGlobals.exports;
|
|
472
|
+
const iife = innerStrict
|
|
473
|
+
? 'it need to be in strict mode.'
|
|
474
|
+
: inlinedModules.size > 1
|
|
475
|
+
? // TODO check globals and top-level declarations of other entries and chunk modules
|
|
476
|
+
// to make a better decision
|
|
477
|
+
'it need to be isolated against other entry modules.'
|
|
478
|
+
: chunkModules
|
|
479
|
+
? 'it need to be isolated against other modules in the chunk.'
|
|
480
|
+
: exports && !webpackExports
|
|
481
|
+
? `it uses a non-standard name for the exports (${m.exportsArgument}).`
|
|
482
|
+
: hooks.embedInRuntimeBailout.call(m, renderContext);
|
|
483
|
+
let footer;
|
|
484
|
+
if (iife !== undefined) {
|
|
485
|
+
startupSource.add(`// This entry need to be wrapped in an IIFE because ${iife}\n`);
|
|
486
|
+
const arrow = runtimeTemplate.supportsArrowFunction();
|
|
487
|
+
if (arrow) {
|
|
488
|
+
startupSource.add('(() => {\n');
|
|
489
|
+
footer = '\n})();\n\n';
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
startupSource.add('!function() {\n');
|
|
493
|
+
footer = '\n}();\n';
|
|
494
|
+
}
|
|
495
|
+
if (innerStrict)
|
|
496
|
+
startupSource.add('"use strict";\n');
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
footer = '\n';
|
|
500
|
+
}
|
|
501
|
+
if (exports) {
|
|
502
|
+
if (m !== lastInlinedModule)
|
|
503
|
+
startupSource.add(`var ${m.exportsArgument} = {};\n`);
|
|
504
|
+
else if (m.exportsArgument !== RuntimeGlobals.exports)
|
|
505
|
+
startupSource.add(`var ${m.exportsArgument} = ${RuntimeGlobals.exports};\n`);
|
|
506
|
+
}
|
|
507
|
+
startupSource.add(renderedModule);
|
|
508
|
+
startupSource.add(footer);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
if (runtimeRequirements.has(RuntimeGlobals.onChunksLoaded)) {
|
|
512
|
+
startupSource.add(`${RuntimeGlobals.exports} = ${RuntimeGlobals.onChunksLoaded}(${RuntimeGlobals.exports});\n`);
|
|
513
|
+
}
|
|
514
|
+
source.add(hooks.renderStartup.call(startupSource, lastInlinedModule, Object.assign(Object.assign({}, renderContext), { inlined: true })));
|
|
515
|
+
if (bootstrap.afterStartup.length > 0) {
|
|
516
|
+
const afterStartup = `${Template_1.Template.asString(bootstrap.afterStartup)}\n`;
|
|
517
|
+
source.add(new webpack_sources_1.PrefixSource(prefix, useSourceMap
|
|
518
|
+
? new webpack_sources_1.OriginalSource(afterStartup, 'webpack/after-startup')
|
|
519
|
+
: new webpack_sources_1.RawSource(afterStartup)));
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
const lastEntryModule = (0, IterableHelpers_1.last)(chunkGraph.getChunkEntryModulesIterable(chunk));
|
|
524
|
+
const toSource = useSourceMap
|
|
525
|
+
? (content, name) => new webpack_sources_1.OriginalSource(Template_1.Template.asString(content), name)
|
|
526
|
+
: content => new webpack_sources_1.RawSource(Template_1.Template.asString(content));
|
|
527
|
+
source.add(new webpack_sources_1.PrefixSource(prefix, new webpack_sources_1.ConcatSource(toSource(bootstrap.beforeStartup, 'webpack/before-startup'), '\n', hooks.renderStartup.call(toSource(bootstrap.startup.concat(''), 'webpack/startup'), lastEntryModule, Object.assign(Object.assign({}, renderContext), { inlined: false })), toSource(bootstrap.afterStartup, 'webpack/after-startup'), '\n')));
|
|
528
|
+
}
|
|
529
|
+
if (hasEntryModules && runtimeRequirements.has(RuntimeGlobals.returnExportsFromRuntime)) {
|
|
530
|
+
source.add(`${prefix}return ${RuntimeGlobals.exports};\n`);
|
|
531
|
+
}
|
|
532
|
+
if (iife) {
|
|
533
|
+
source.add('/******/ })()\n');
|
|
534
|
+
}
|
|
535
|
+
let finalSource = (0, HookBaseError_1.tryRunOrBaseError)(() => hooks.renderMain.call(source, renderContext), 'JavascriptModulesPlugin.getCompilationHooks().renderMain');
|
|
536
|
+
if (!finalSource) {
|
|
537
|
+
throw new Error('JavascriptModulesPlugin error: JavascriptModulesPlugin.getCompilationHooks().renderMain plugins should return something');
|
|
538
|
+
}
|
|
539
|
+
finalSource = (0, HookBaseError_1.tryRunOrBaseError)(() => hooks.renderContent.call(finalSource, renderContext), 'JavascriptModulesPlugin.getCompilationHooks().renderContent');
|
|
540
|
+
if (!finalSource) {
|
|
541
|
+
throw new Error('JavascriptModulesPlugin error: JavascriptModulesPlugin.getCompilationHooks().renderContent plugins should return something');
|
|
542
|
+
}
|
|
543
|
+
finalSource = InitFragment_1.default.addToSource(finalSource, chunkRenderContext.chunkInitFragments, chunkRenderContext);
|
|
544
|
+
finalSource = (0, HookBaseError_1.tryRunOrBaseError)(() => hooks.render.call(finalSource, renderContext), 'JavascriptModulesPlugin.getCompilationHooks().render');
|
|
545
|
+
if (!finalSource) {
|
|
546
|
+
throw new Error('JavascriptModulesPlugin error: JavascriptModulesPlugin.getCompilationHooks().render plugins should return something');
|
|
547
|
+
}
|
|
548
|
+
chunk.rendered = true;
|
|
549
|
+
return iife ? new webpack_sources_1.ConcatSource(finalSource, ';') : finalSource;
|
|
550
|
+
}
|
|
551
|
+
updateHashWithBootstrap(hash, renderContext, hooks) {
|
|
552
|
+
const bootstrap = this.renderBootstrap(renderContext, hooks);
|
|
553
|
+
for (const key of Object.keys(bootstrap)) {
|
|
554
|
+
hash.update(key);
|
|
555
|
+
if (Array.isArray(bootstrap[key])) {
|
|
556
|
+
for (const line of bootstrap[key]) {
|
|
557
|
+
hash.update(line);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
else {
|
|
561
|
+
hash.update(JSON.stringify(bootstrap[key]));
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
renderBootstrap(renderContext, hooks) {
|
|
566
|
+
const { chunkGraph, codeGenerationResults, moduleGraph, chunk, runtimeTemplate } = renderContext;
|
|
567
|
+
const runtimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
|
|
568
|
+
const requireFunction = runtimeRequirements.has(RuntimeGlobals.require);
|
|
569
|
+
const moduleCache = runtimeRequirements.has(RuntimeGlobals.moduleCache);
|
|
570
|
+
const moduleFactories = runtimeRequirements.has(RuntimeGlobals.moduleFactories);
|
|
571
|
+
const moduleUsed = runtimeRequirements.has(RuntimeGlobals.module);
|
|
572
|
+
const requireScopeUsed = runtimeRequirements.has(RuntimeGlobals.requireScope);
|
|
573
|
+
const interceptModuleExecution = runtimeRequirements.has(RuntimeGlobals.interceptModuleExecution);
|
|
574
|
+
const useRequire = requireFunction || interceptModuleExecution || moduleUsed;
|
|
575
|
+
const result = {
|
|
576
|
+
header: [],
|
|
577
|
+
beforeStartup: [],
|
|
578
|
+
startup: [],
|
|
579
|
+
afterStartup: [],
|
|
580
|
+
allowInlineStartup: true,
|
|
581
|
+
};
|
|
582
|
+
const { header: buf, startup, beforeStartup, afterStartup } = result;
|
|
583
|
+
if (result.allowInlineStartup && moduleFactories) {
|
|
584
|
+
startup.push('// module factories are used so entry inlining is disabled');
|
|
585
|
+
result.allowInlineStartup = false;
|
|
586
|
+
}
|
|
587
|
+
if (result.allowInlineStartup && moduleCache) {
|
|
588
|
+
startup.push('// module cache are used so entry inlining is disabled');
|
|
589
|
+
result.allowInlineStartup = false;
|
|
590
|
+
}
|
|
591
|
+
if (result.allowInlineStartup && interceptModuleExecution) {
|
|
592
|
+
startup.push('// module execution is intercepted so entry inlining is disabled');
|
|
593
|
+
result.allowInlineStartup = false;
|
|
594
|
+
}
|
|
595
|
+
if (useRequire || moduleCache) {
|
|
596
|
+
buf.push('// The module cache');
|
|
597
|
+
buf.push('var __webpack_module_cache__ = {};');
|
|
598
|
+
buf.push('');
|
|
599
|
+
}
|
|
600
|
+
if (useRequire) {
|
|
601
|
+
buf.push('// The require function');
|
|
602
|
+
buf.push(`function ${RuntimeGlobals.require}(moduleId) {`);
|
|
603
|
+
buf.push(Template_1.Template.indent(this.renderRequire(renderContext, hooks)));
|
|
604
|
+
buf.push('}');
|
|
605
|
+
buf.push('');
|
|
606
|
+
}
|
|
607
|
+
else if (runtimeRequirements.has(RuntimeGlobals.requireScope)) {
|
|
608
|
+
buf.push('// The require scope');
|
|
609
|
+
buf.push(`var ${RuntimeGlobals.require} = {};`);
|
|
610
|
+
buf.push('');
|
|
611
|
+
}
|
|
612
|
+
if (moduleFactories || runtimeRequirements.has(RuntimeGlobals.moduleFactoriesAddOnly)) {
|
|
613
|
+
buf.push('// expose the modules object (__webpack_modules__)');
|
|
614
|
+
buf.push(`${RuntimeGlobals.moduleFactories} = __webpack_modules__;`);
|
|
615
|
+
buf.push('');
|
|
616
|
+
}
|
|
617
|
+
if (moduleCache) {
|
|
618
|
+
buf.push('// expose the module cache');
|
|
619
|
+
buf.push(`${RuntimeGlobals.moduleCache} = __webpack_module_cache__;`);
|
|
620
|
+
buf.push('');
|
|
621
|
+
}
|
|
622
|
+
if (interceptModuleExecution) {
|
|
623
|
+
buf.push('// expose the module execution interceptor');
|
|
624
|
+
buf.push(`${RuntimeGlobals.interceptModuleExecution} = [];`);
|
|
625
|
+
buf.push('');
|
|
626
|
+
}
|
|
627
|
+
if (!runtimeRequirements.has(RuntimeGlobals.startupNoDefault)) {
|
|
628
|
+
if (chunkGraph.getNumberOfEntryModules(chunk) > 0) {
|
|
629
|
+
const buf2 = [];
|
|
630
|
+
const runtimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
|
|
631
|
+
buf2.push('// Load entry module and return exports');
|
|
632
|
+
let i = chunkGraph.getNumberOfEntryModules(chunk);
|
|
633
|
+
for (const [entryModule, entrypoint,] of chunkGraph.getChunkEntryModulesWithChunkGroupIterable(chunk)) {
|
|
634
|
+
const chunks = entrypoint.chunks.filter(c => c !== chunk);
|
|
635
|
+
if (result.allowInlineStartup && chunks.length > 0) {
|
|
636
|
+
buf2.push('// This entry module depends on other loaded chunks and execution need to be delayed');
|
|
637
|
+
result.allowInlineStartup = false;
|
|
638
|
+
}
|
|
639
|
+
if (result.allowInlineStartup &&
|
|
640
|
+
(0, IterableHelpers_1.someInIterable)(moduleGraph.getIncomingConnectionsByOriginModule(entryModule), ([originModule, connections]) => originModule &&
|
|
641
|
+
connections.some(c => c.isTargetActive(chunk.runtime)) &&
|
|
642
|
+
(0, IterableHelpers_1.someInIterable)(chunkGraph.getModuleRuntimes(originModule), runtime => (0, RuntimeHelpers_1.intersectRuntime)(runtime, chunk.runtime) !== undefined))) {
|
|
643
|
+
buf2.push("// This entry module is referenced by other modules so it can't be inlined");
|
|
644
|
+
result.allowInlineStartup = false;
|
|
645
|
+
}
|
|
646
|
+
let data;
|
|
647
|
+
if (codeGenerationResults.has(entryModule, chunk.runtime)) {
|
|
648
|
+
const result = codeGenerationResults.get(entryModule, chunk.runtime);
|
|
649
|
+
data = result.data;
|
|
650
|
+
}
|
|
651
|
+
if (result.allowInlineStartup &&
|
|
652
|
+
(!data || !data.get('topLevelDeclarations')) &&
|
|
653
|
+
(!entryModule.buildInfo || !entryModule.buildInfo.topLevelDeclarations)) {
|
|
654
|
+
buf2.push("// This entry module doesn't tell about it's top-level declarations so it can't be inlined");
|
|
655
|
+
result.allowInlineStartup = false;
|
|
656
|
+
}
|
|
657
|
+
if (result.allowInlineStartup) {
|
|
658
|
+
const bailout = hooks.inlineInRuntimeBailout.call(entryModule, renderContext);
|
|
659
|
+
if (bailout !== undefined) {
|
|
660
|
+
buf2.push(`// This entry module can't be inlined because ${bailout}`);
|
|
661
|
+
result.allowInlineStartup = false;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
i--;
|
|
665
|
+
const moduleId = chunkGraph.getModuleId(entryModule);
|
|
666
|
+
const entryRuntimeRequirements = chunkGraph.getModuleRuntimeRequirements(entryModule, chunk.runtime);
|
|
667
|
+
let moduleIdExpr = JSON.stringify(moduleId);
|
|
668
|
+
if (runtimeRequirements.has(RuntimeGlobals.entryModuleId)) {
|
|
669
|
+
moduleIdExpr = `${RuntimeGlobals.entryModuleId} = ${moduleIdExpr}`;
|
|
670
|
+
}
|
|
671
|
+
if (result.allowInlineStartup && entryRuntimeRequirements.has(RuntimeGlobals.module)) {
|
|
672
|
+
result.allowInlineStartup = false;
|
|
673
|
+
buf2.push("// This entry module used 'module' so it can't be inlined");
|
|
674
|
+
}
|
|
675
|
+
if (chunks.length > 0) {
|
|
676
|
+
buf2.push(`${i === 0 ? `var ${RuntimeGlobals.exports} = ` : ''}${RuntimeGlobals.onChunksLoaded}(undefined, ${JSON.stringify(chunks.map(c => c.id))}, ${runtimeTemplate.returningFunction(`${RuntimeGlobals.require}(${moduleIdExpr})`)})`);
|
|
677
|
+
}
|
|
678
|
+
else if (useRequire) {
|
|
679
|
+
buf2.push(`${i === 0 ? `var ${RuntimeGlobals.exports} = ` : ''}${RuntimeGlobals.require}(${moduleIdExpr});`);
|
|
680
|
+
}
|
|
681
|
+
else {
|
|
682
|
+
if (i === 0)
|
|
683
|
+
buf2.push(`var ${RuntimeGlobals.exports} = {};`);
|
|
684
|
+
if (requireScopeUsed) {
|
|
685
|
+
buf2.push(`__webpack_modules__[${moduleIdExpr}](0, ${i === 0 ? RuntimeGlobals.exports : '{}'}, ${RuntimeGlobals.require});`);
|
|
686
|
+
}
|
|
687
|
+
else if (entryRuntimeRequirements.has(RuntimeGlobals.exports)) {
|
|
688
|
+
buf2.push(`__webpack_modules__[${moduleIdExpr}](0, ${i === 0 ? RuntimeGlobals.exports : '{}'});`);
|
|
689
|
+
}
|
|
690
|
+
else {
|
|
691
|
+
buf2.push(`__webpack_modules__[${moduleIdExpr}]();`);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
if (runtimeRequirements.has(RuntimeGlobals.onChunksLoaded)) {
|
|
696
|
+
buf2.push(`${RuntimeGlobals.exports} = ${RuntimeGlobals.onChunksLoaded}(${RuntimeGlobals.exports});`);
|
|
697
|
+
}
|
|
698
|
+
if (runtimeRequirements.has(RuntimeGlobals.startup) ||
|
|
699
|
+
(runtimeRequirements.has(RuntimeGlobals.startupOnlyBefore) &&
|
|
700
|
+
runtimeRequirements.has(RuntimeGlobals.startupOnlyAfter))) {
|
|
701
|
+
result.allowInlineStartup = false;
|
|
702
|
+
buf.push('// the startup function');
|
|
703
|
+
buf.push(`${RuntimeGlobals.startup} = ${runtimeTemplate.basicFunction('', [
|
|
704
|
+
...buf2,
|
|
705
|
+
`return ${RuntimeGlobals.exports};`,
|
|
706
|
+
])};`);
|
|
707
|
+
buf.push('');
|
|
708
|
+
startup.push('// run startup');
|
|
709
|
+
startup.push(`var ${RuntimeGlobals.exports} = ${RuntimeGlobals.startup}();`);
|
|
710
|
+
}
|
|
711
|
+
else if (runtimeRequirements.has(RuntimeGlobals.startupOnlyBefore)) {
|
|
712
|
+
buf.push('// the startup function');
|
|
713
|
+
buf.push(`${RuntimeGlobals.startup} = ${runtimeTemplate.emptyFunction()};`);
|
|
714
|
+
beforeStartup.push('// run runtime startup');
|
|
715
|
+
beforeStartup.push(`${RuntimeGlobals.startup}();`);
|
|
716
|
+
startup.push('// startup');
|
|
717
|
+
startup.push(Template_1.Template.asString(buf2));
|
|
718
|
+
}
|
|
719
|
+
else if (runtimeRequirements.has(RuntimeGlobals.startupOnlyAfter)) {
|
|
720
|
+
buf.push('// the startup function');
|
|
721
|
+
buf.push(`${RuntimeGlobals.startup} = ${runtimeTemplate.emptyFunction()};`);
|
|
722
|
+
startup.push('// startup');
|
|
723
|
+
startup.push(Template_1.Template.asString(buf2));
|
|
724
|
+
afterStartup.push('// run runtime startup');
|
|
725
|
+
afterStartup.push(`${RuntimeGlobals.startup}();`);
|
|
726
|
+
}
|
|
727
|
+
else {
|
|
728
|
+
startup.push('// startup');
|
|
729
|
+
startup.push(Template_1.Template.asString(buf2));
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
else if (runtimeRequirements.has(RuntimeGlobals.startup) ||
|
|
733
|
+
runtimeRequirements.has(RuntimeGlobals.startupOnlyBefore) ||
|
|
734
|
+
runtimeRequirements.has(RuntimeGlobals.startupOnlyAfter)) {
|
|
735
|
+
buf.push('// the startup function', "// It's empty as no entry modules are in this chunk", `${RuntimeGlobals.startup} = ${runtimeTemplate.emptyFunction()};`, '');
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
else if (runtimeRequirements.has(RuntimeGlobals.startup) ||
|
|
739
|
+
runtimeRequirements.has(RuntimeGlobals.startupOnlyBefore) ||
|
|
740
|
+
runtimeRequirements.has(RuntimeGlobals.startupOnlyAfter)) {
|
|
741
|
+
result.allowInlineStartup = false;
|
|
742
|
+
buf.push('// the startup function', "// It's empty as some runtime module handles the default behavior", `${RuntimeGlobals.startup} = ${runtimeTemplate.emptyFunction()};`);
|
|
743
|
+
startup.push('// run startup');
|
|
744
|
+
startup.push(`var ${RuntimeGlobals.exports} = ${RuntimeGlobals.startup}();`);
|
|
745
|
+
}
|
|
746
|
+
return result;
|
|
747
|
+
}
|
|
748
|
+
renderRequire(renderContext, hooks) {
|
|
749
|
+
const { chunk, chunkGraph, runtimeTemplate: { outputOptions }, } = renderContext;
|
|
750
|
+
const runtimeRequirements = chunkGraph.getTreeRuntimeRequirements(chunk);
|
|
751
|
+
const moduleExecution = runtimeRequirements.has(RuntimeGlobals.interceptModuleExecution)
|
|
752
|
+
? Template_1.Template.asString([
|
|
753
|
+
`var execOptions = { id: moduleId, module: module, factory: __webpack_modules__[moduleId], require: ${RuntimeGlobals.require} };`,
|
|
754
|
+
`${RuntimeGlobals.interceptModuleExecution}.forEach(function(handler) { handler(execOptions); });`,
|
|
755
|
+
'module = execOptions.module;',
|
|
756
|
+
'execOptions.factory.call(module.exports, module, module.exports, execOptions.require);',
|
|
757
|
+
])
|
|
758
|
+
: runtimeRequirements.has(RuntimeGlobals.thisAsExports)
|
|
759
|
+
? Template_1.Template.asString([
|
|
760
|
+
`__webpack_modules__[moduleId].call(module.exports, module, module.exports, ${RuntimeGlobals.require});`,
|
|
761
|
+
])
|
|
762
|
+
: Template_1.Template.asString([
|
|
763
|
+
`__webpack_modules__[moduleId](module, module.exports, ${RuntimeGlobals.require});`,
|
|
764
|
+
]);
|
|
765
|
+
const needModuleId = runtimeRequirements.has(RuntimeGlobals.moduleId);
|
|
766
|
+
const needModuleLoaded = runtimeRequirements.has(RuntimeGlobals.moduleLoaded);
|
|
767
|
+
const content = Template_1.Template.asString([
|
|
768
|
+
'// Check if module is in cache',
|
|
769
|
+
'var cachedModule = __webpack_module_cache__[moduleId];',
|
|
770
|
+
'if (cachedModule !== undefined) {',
|
|
771
|
+
outputOptions.strictModuleErrorHandling
|
|
772
|
+
? Template_1.Template.indent([
|
|
773
|
+
'if (cachedModule.error !== undefined) throw cachedModule.error;',
|
|
774
|
+
'return cachedModule.exports;',
|
|
775
|
+
])
|
|
776
|
+
: Template_1.Template.indent('return cachedModule.exports;'),
|
|
777
|
+
'}',
|
|
778
|
+
'// Create a new module (and put it into the cache)',
|
|
779
|
+
'var module = __webpack_module_cache__[moduleId] = {',
|
|
780
|
+
Template_1.Template.indent([
|
|
781
|
+
needModuleId ? 'id: moduleId,' : '// no module.id needed',
|
|
782
|
+
needModuleLoaded ? 'loaded: false,' : '// no module.loaded needed',
|
|
783
|
+
'exports: {}',
|
|
784
|
+
]),
|
|
785
|
+
'};',
|
|
786
|
+
'',
|
|
787
|
+
outputOptions.strictModuleExceptionHandling
|
|
788
|
+
? Template_1.Template.asString([
|
|
789
|
+
'// Execute the module function',
|
|
790
|
+
'var threw = true;',
|
|
791
|
+
'try {',
|
|
792
|
+
Template_1.Template.indent([moduleExecution, 'threw = false;']),
|
|
793
|
+
'} finally {',
|
|
794
|
+
Template_1.Template.indent(['if(threw) delete __webpack_module_cache__[moduleId];']),
|
|
795
|
+
'}',
|
|
796
|
+
])
|
|
797
|
+
: outputOptions.strictModuleErrorHandling
|
|
798
|
+
? Template_1.Template.asString([
|
|
799
|
+
'// Execute the module function',
|
|
800
|
+
'try {',
|
|
801
|
+
Template_1.Template.indent(moduleExecution),
|
|
802
|
+
'} catch(e) {',
|
|
803
|
+
Template_1.Template.indent(['module.error = e;', 'throw e;']),
|
|
804
|
+
'}',
|
|
805
|
+
])
|
|
806
|
+
: Template_1.Template.asString(['// Execute the module function', moduleExecution]),
|
|
807
|
+
needModuleLoaded
|
|
808
|
+
? Template_1.Template.asString([
|
|
809
|
+
'',
|
|
810
|
+
'// Flag the module as loaded',
|
|
811
|
+
`${RuntimeGlobals.moduleLoaded} = true;`,
|
|
812
|
+
'',
|
|
813
|
+
])
|
|
814
|
+
: '',
|
|
815
|
+
'// Return the exports of the module',
|
|
816
|
+
'return module.exports;',
|
|
817
|
+
]);
|
|
818
|
+
return (0, HookBaseError_1.tryRunOrBaseError)(() => hooks.renderRequire.call(content, renderContext), 'JavascriptModulesPlugin.getCompilationHooks().renderRequire');
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
exports.JavascriptModulesPlugin = JavascriptModulesPlugin;
|