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
package/dist/Compiler.js
ADDED
|
@@ -0,0 +1,845 @@
|
|
|
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 json_parse_even_better_errors_1 = __importDefault(require("json-parse-even-better-errors"));
|
|
30
|
+
const neo_async_1 = __importDefault(require("neo-async"));
|
|
31
|
+
const tapable_1 = require("tapable");
|
|
32
|
+
const webpack_sources_1 = require("webpack-sources");
|
|
33
|
+
const Cache_1 = __importDefault(require("@/cache/Cache"));
|
|
34
|
+
const CacheFacade_1 = require("@/cache/CacheFacade");
|
|
35
|
+
const ChunkGraph_1 = __importDefault(require("@/chunk/ChunkGraph"));
|
|
36
|
+
const ConcurrentCompilationError_1 = __importDefault(require("@/base/errors/ConcurrentCompilationError"));
|
|
37
|
+
const ContextModuleFactory_1 = __importDefault(require("@/module/ContextModuleFactory"));
|
|
38
|
+
const ModuleGraph_1 = __importDefault(require("@/module/ModuleGraph"));
|
|
39
|
+
const NormalModuleFactory_1 = __importDefault(require("@/module/NormalModuleFactory"));
|
|
40
|
+
const RequestShortener_1 = __importDefault(require("@/base/RequestShortener"));
|
|
41
|
+
const Stats_1 = __importDefault(require("@/base/stats/Stats"));
|
|
42
|
+
const BaseError_1 = __importDefault(require("@/base/errors/BaseError"));
|
|
43
|
+
const fs_1 = require("@/base/fs");
|
|
44
|
+
const identifier_1 = require("@/base/identifier");
|
|
45
|
+
const source_1 = require("@/base/source");
|
|
46
|
+
const ModuleFilenameHelpers = __importStar(require("@/base/ModuleFilenameHelpers"));
|
|
47
|
+
const JavascriptModulesPlugin_1 = require("./module/javascript/JavascriptModulesPlugin");
|
|
48
|
+
const Logger_1 = require("./base/logging/Logger");
|
|
49
|
+
const Watching_1 = __importDefault(require("./Watching"));
|
|
50
|
+
const ResolverFactory_1 = __importDefault(require("./ResolverFactory"));
|
|
51
|
+
const Compilation_1 = __importDefault(require("./Compilation"));
|
|
52
|
+
const MPPack_1 = require("./MPPack");
|
|
53
|
+
const isSorted = (array) => {
|
|
54
|
+
for (let i = 1; i < array.length; i++) {
|
|
55
|
+
if (array[i - 1] > array[i])
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
return true;
|
|
59
|
+
};
|
|
60
|
+
const sortObject = (obj, keys) => {
|
|
61
|
+
const o = {};
|
|
62
|
+
for (const k of keys.sort()) {
|
|
63
|
+
o[k] = obj[k];
|
|
64
|
+
}
|
|
65
|
+
return o;
|
|
66
|
+
};
|
|
67
|
+
const includesHash = (filename, hashes) => {
|
|
68
|
+
if (!hashes)
|
|
69
|
+
return false;
|
|
70
|
+
if (Array.isArray(hashes)) {
|
|
71
|
+
return hashes.some(hash => filename.includes(hash));
|
|
72
|
+
}
|
|
73
|
+
return filename.includes(hashes);
|
|
74
|
+
};
|
|
75
|
+
class Compiler {
|
|
76
|
+
constructor(project, packSetting, options = {}) {
|
|
77
|
+
this.context = '';
|
|
78
|
+
this.options = {};
|
|
79
|
+
this.outputPath = '';
|
|
80
|
+
this.outputFileSystem = null;
|
|
81
|
+
this.intermediateFileSystem = null;
|
|
82
|
+
this.inputFileSystem = null;
|
|
83
|
+
this.watchFileSystem = null;
|
|
84
|
+
this.recordsInputPath = null;
|
|
85
|
+
this.recordsOutputPath = null;
|
|
86
|
+
this.records = {};
|
|
87
|
+
this.managedPaths = new Set();
|
|
88
|
+
this.immutablePaths = new Set();
|
|
89
|
+
this.compilerPath = '';
|
|
90
|
+
this.running = false;
|
|
91
|
+
this.idle = false;
|
|
92
|
+
this.watchMode = false;
|
|
93
|
+
this._assetEmittingSourceCache = new WeakMap();
|
|
94
|
+
this._assetEmittingWrittenFiles = new Map();
|
|
95
|
+
this._assetEmittingPreviousFiles = new Set();
|
|
96
|
+
this.hooks = Object.freeze({
|
|
97
|
+
initialize: new tapable_1.SyncHook([]),
|
|
98
|
+
shouldEmit: new tapable_1.SyncBailHook(['compilation']),
|
|
99
|
+
done: new tapable_1.AsyncSeriesHook(['stats']),
|
|
100
|
+
afterDone: new tapable_1.SyncHook(['stats']),
|
|
101
|
+
additionalPass: new tapable_1.AsyncSeriesHook([]),
|
|
102
|
+
beforeRun: new tapable_1.AsyncSeriesHook(['compiler']),
|
|
103
|
+
run: new tapable_1.AsyncSeriesHook(['compiler']),
|
|
104
|
+
emit: new tapable_1.AsyncSeriesHook(['compilation']),
|
|
105
|
+
assetEmitted: new tapable_1.AsyncSeriesHook(['file', 'info']),
|
|
106
|
+
afterEmit: new tapable_1.AsyncSeriesHook(['compilation']),
|
|
107
|
+
thisCompilation: new tapable_1.SyncHook(['compilation', 'params']),
|
|
108
|
+
compilation: new tapable_1.SyncHook(['compilation', 'params']),
|
|
109
|
+
normalModuleFactory: new tapable_1.SyncHook(['normalModuleFactory']),
|
|
110
|
+
contextModuleFactory: new tapable_1.SyncHook(['contextModuleFactory']),
|
|
111
|
+
beforeCompile: new tapable_1.AsyncSeriesHook(['params']),
|
|
112
|
+
compile: new tapable_1.SyncHook(['params']),
|
|
113
|
+
make: new tapable_1.AsyncParallelHook(['compilation']),
|
|
114
|
+
finishMake: new tapable_1.AsyncSeriesHook(['compilation']),
|
|
115
|
+
afterCompile: new tapable_1.AsyncSeriesHook(['compilation']),
|
|
116
|
+
readRecords: new tapable_1.AsyncSeriesHook([]),
|
|
117
|
+
emitRecords: new tapable_1.AsyncSeriesHook([]),
|
|
118
|
+
watchRun: new tapable_1.AsyncSeriesHook(['compiler']),
|
|
119
|
+
failed: new tapable_1.SyncHook(['error']),
|
|
120
|
+
invalid: new tapable_1.SyncHook(['filename', 'changeTime']),
|
|
121
|
+
watchClose: new tapable_1.SyncHook([]),
|
|
122
|
+
shutdown: new tapable_1.AsyncSeriesHook([]),
|
|
123
|
+
infrastructureLog: new tapable_1.SyncBailHook(['origin', 'type', 'args']),
|
|
124
|
+
// TODO the following hooks are weirdly located here
|
|
125
|
+
environment: new tapable_1.SyncHook([]),
|
|
126
|
+
afterEnvironment: new tapable_1.SyncHook([]),
|
|
127
|
+
afterResolvers: new tapable_1.SyncHook(['compiler']),
|
|
128
|
+
entryOption: new tapable_1.SyncBailHook(['context', 'entry']),
|
|
129
|
+
});
|
|
130
|
+
this.root = this;
|
|
131
|
+
this.resolverFactory = new ResolverFactory_1.default();
|
|
132
|
+
this.project = project;
|
|
133
|
+
this.packSetting = packSetting;
|
|
134
|
+
this.context = options.context;
|
|
135
|
+
this.options = options;
|
|
136
|
+
this.requestShortener = new RequestShortener_1.default(this.context, this.root);
|
|
137
|
+
this.cache = new Cache_1.default();
|
|
138
|
+
this.compilerPath = '';
|
|
139
|
+
this.running = false;
|
|
140
|
+
this.idle = false;
|
|
141
|
+
this.watchMode = false;
|
|
142
|
+
this.makeWebpackCompalibility();
|
|
143
|
+
}
|
|
144
|
+
// 注册webpack对象,兼容webpack插件
|
|
145
|
+
makeWebpackCompalibility() {
|
|
146
|
+
this.MPPack = MPPack_1.MPPack;
|
|
147
|
+
// @ts-ignore
|
|
148
|
+
this.webpack = {
|
|
149
|
+
javascript: {
|
|
150
|
+
JavascriptModulesPlugin: JavascriptModulesPlugin_1.JavascriptModulesPlugin,
|
|
151
|
+
},
|
|
152
|
+
Compilation: Compilation_1.default,
|
|
153
|
+
ModuleFilenameHelpers,
|
|
154
|
+
sources: {
|
|
155
|
+
SourceMapSource: webpack_sources_1.SourceMapSource,
|
|
156
|
+
ConcatSource: webpack_sources_1.ConcatSource,
|
|
157
|
+
RawSource: webpack_sources_1.RawSource,
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
getCache(name) {
|
|
162
|
+
return new CacheFacade_1.CacheFacade(this.cache, `${this.compilerPath}${name}`, this.options.output.hashFunction);
|
|
163
|
+
}
|
|
164
|
+
getInfrastructureLogger(name) {
|
|
165
|
+
if (!name) {
|
|
166
|
+
throw new TypeError('Compiler.getInfrastructureLogger(name) called without a name');
|
|
167
|
+
}
|
|
168
|
+
return new Logger_1.Logger((type, args) => {
|
|
169
|
+
if (typeof name === 'function') {
|
|
170
|
+
name = name();
|
|
171
|
+
if (!name) {
|
|
172
|
+
throw new TypeError('Compiler.getInfrastructureLogger(name) called with a function not returning a name');
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (this.hooks.infrastructureLog.call(name, type, args) === undefined) {
|
|
176
|
+
if (this.infrastructureLogger !== undefined) {
|
|
177
|
+
this.infrastructureLogger(name, type, args);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}, childName => {
|
|
181
|
+
if (typeof name === 'function') {
|
|
182
|
+
if (typeof childName === 'function') {
|
|
183
|
+
return this.getInfrastructureLogger(() => {
|
|
184
|
+
if (typeof name === 'function') {
|
|
185
|
+
name = name();
|
|
186
|
+
if (!name) {
|
|
187
|
+
throw new TypeError('Compiler.getInfrastructureLogger(name) called with a function not returning a name');
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (typeof childName === 'function') {
|
|
191
|
+
childName = childName();
|
|
192
|
+
if (!childName) {
|
|
193
|
+
throw new TypeError('Logger.getChildLogger(name) called with a function not returning a name');
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return `${name}/${childName}`;
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return this.getInfrastructureLogger(() => {
|
|
200
|
+
if (typeof name === 'function') {
|
|
201
|
+
name = name();
|
|
202
|
+
if (!name) {
|
|
203
|
+
throw new TypeError('Compiler.getInfrastructureLogger(name) called with a function not returning a name');
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return `${name}/${childName}`;
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (typeof childName === 'function') {
|
|
210
|
+
return this.getInfrastructureLogger(() => {
|
|
211
|
+
if (typeof childName === 'function') {
|
|
212
|
+
childName = childName();
|
|
213
|
+
if (!childName) {
|
|
214
|
+
throw new TypeError('Logger.getChildLogger(name) called with a function not returning a name');
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return `${name}/${childName}`;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return this.getInfrastructureLogger(`${name}/${childName}`);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
// e.g. move compilation specific info from Modules into ModuleGraph
|
|
224
|
+
_cleanupLastCompilation() {
|
|
225
|
+
if (this._lastCompilation !== undefined) {
|
|
226
|
+
for (const module of this._lastCompilation.modules) {
|
|
227
|
+
ChunkGraph_1.default.clearChunkGraphForModule(module);
|
|
228
|
+
ModuleGraph_1.default.clearModuleGraphForModule(module);
|
|
229
|
+
module.cleanupForCache();
|
|
230
|
+
}
|
|
231
|
+
for (const chunk of this._lastCompilation.chunks) {
|
|
232
|
+
ChunkGraph_1.default.clearChunkGraphForChunk(chunk);
|
|
233
|
+
}
|
|
234
|
+
this._lastCompilation = undefined;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
_cleanupLastNormalModuleFactory() {
|
|
238
|
+
if (this._lastNormalModuleFactory !== undefined) {
|
|
239
|
+
this._lastNormalModuleFactory.cleanupForCache();
|
|
240
|
+
this._lastNormalModuleFactory = undefined;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
watch(watchOptions, handler) {
|
|
244
|
+
if (this.running) {
|
|
245
|
+
return handler(new ConcurrentCompilationError_1.default());
|
|
246
|
+
}
|
|
247
|
+
this.running = true;
|
|
248
|
+
this.watchMode = true;
|
|
249
|
+
this.watching = new Watching_1.default(this, watchOptions, handler);
|
|
250
|
+
return this.watching;
|
|
251
|
+
}
|
|
252
|
+
run(callback) {
|
|
253
|
+
if (this.running) {
|
|
254
|
+
return callback(new ConcurrentCompilationError_1.default());
|
|
255
|
+
}
|
|
256
|
+
let logger;
|
|
257
|
+
const finalCallback = (err, stats) => {
|
|
258
|
+
if (logger)
|
|
259
|
+
logger.time('beginIdle');
|
|
260
|
+
this.idle = true;
|
|
261
|
+
this.cache.beginIdle();
|
|
262
|
+
this.idle = true;
|
|
263
|
+
if (logger)
|
|
264
|
+
logger.timeEnd('beginIdle');
|
|
265
|
+
this.running = false;
|
|
266
|
+
if (err) {
|
|
267
|
+
this.hooks.failed.call(err);
|
|
268
|
+
}
|
|
269
|
+
if (callback !== undefined)
|
|
270
|
+
callback(err, stats);
|
|
271
|
+
this.hooks.afterDone.call(stats);
|
|
272
|
+
};
|
|
273
|
+
const startTime = Date.now();
|
|
274
|
+
this.running = true;
|
|
275
|
+
const onCompiled = (err, compilation) => {
|
|
276
|
+
if (err)
|
|
277
|
+
return finalCallback(err);
|
|
278
|
+
if (this.hooks.shouldEmit.call(compilation) === false) {
|
|
279
|
+
compilation.startTime = startTime;
|
|
280
|
+
compilation.endTime = Date.now();
|
|
281
|
+
const stats = new Stats_1.default(compilation);
|
|
282
|
+
this.hooks.done.callAsync(stats, err => {
|
|
283
|
+
if (err)
|
|
284
|
+
return finalCallback(err);
|
|
285
|
+
return finalCallback(null, stats);
|
|
286
|
+
});
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
process.nextTick(() => {
|
|
290
|
+
logger = compilation.getLogger('webpack.Compiler');
|
|
291
|
+
logger.time('emitAssets');
|
|
292
|
+
this.emitAssets(compilation, err => {
|
|
293
|
+
logger.timeEnd('emitAssets');
|
|
294
|
+
if (err)
|
|
295
|
+
return finalCallback(err);
|
|
296
|
+
logger.time('emitRecords');
|
|
297
|
+
this.emitRecords(err => {
|
|
298
|
+
logger.timeEnd('emitRecords');
|
|
299
|
+
if (err)
|
|
300
|
+
return finalCallback(err);
|
|
301
|
+
compilation.startTime = startTime;
|
|
302
|
+
compilation.endTime = Date.now();
|
|
303
|
+
logger.time('done hook');
|
|
304
|
+
const stats = new Stats_1.default(compilation);
|
|
305
|
+
this.hooks.done.callAsync(stats, err => {
|
|
306
|
+
logger.timeEnd('done hook');
|
|
307
|
+
if (err)
|
|
308
|
+
return finalCallback(err);
|
|
309
|
+
this.cache.storeBuildDependencies(compilation.buildDependencies, err => {
|
|
310
|
+
if (err)
|
|
311
|
+
return finalCallback(err);
|
|
312
|
+
return finalCallback(null, stats);
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
};
|
|
319
|
+
const run = () => {
|
|
320
|
+
this.hooks.beforeRun.callAsync(this, err => {
|
|
321
|
+
if (err)
|
|
322
|
+
return finalCallback(err);
|
|
323
|
+
this.hooks.run.callAsync(this, err => {
|
|
324
|
+
if (err)
|
|
325
|
+
return finalCallback(err);
|
|
326
|
+
this.readRecords(err => {
|
|
327
|
+
if (err)
|
|
328
|
+
return finalCallback(err);
|
|
329
|
+
this.compile(onCompiled);
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
if (this.idle) {
|
|
335
|
+
this.cache.endIdle(err => {
|
|
336
|
+
if (err)
|
|
337
|
+
return finalCallback(err);
|
|
338
|
+
this.idle = false;
|
|
339
|
+
run();
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
run();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
runAsChild(callback) {
|
|
347
|
+
const startTime = Date.now();
|
|
348
|
+
const finalCallback = (err, entries, compilation) => {
|
|
349
|
+
try {
|
|
350
|
+
callback(err, entries, compilation);
|
|
351
|
+
}
|
|
352
|
+
catch (e) {
|
|
353
|
+
const err = new BaseError_1.default(`compiler.runAsChild callback error: ${e}`);
|
|
354
|
+
err.details = e.stack;
|
|
355
|
+
this.parentCompilation.errors.push(err);
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
this.compile((err, compilation) => {
|
|
359
|
+
if (err)
|
|
360
|
+
return finalCallback(err);
|
|
361
|
+
this.parentCompilation.children.push(compilation);
|
|
362
|
+
for (const { name, source, info } of compilation.getAssets()) {
|
|
363
|
+
this.parentCompilation.emitAsset(name, source, info);
|
|
364
|
+
}
|
|
365
|
+
const entries = [];
|
|
366
|
+
for (const ep of compilation.entrypoints.values()) {
|
|
367
|
+
entries.push(...ep.chunks);
|
|
368
|
+
}
|
|
369
|
+
compilation.startTime = startTime;
|
|
370
|
+
compilation.endTime = Date.now();
|
|
371
|
+
return finalCallback(null, entries, compilation);
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
purgeInputFileSystem() {
|
|
375
|
+
var _a;
|
|
376
|
+
if ((_a = this.inputFileSystem) === null || _a === void 0 ? void 0 : _a.purge) {
|
|
377
|
+
this.inputFileSystem.purge();
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
emitAssets(compilation, callback) {
|
|
381
|
+
let outputPath;
|
|
382
|
+
const emitFiles = err => {
|
|
383
|
+
if (err)
|
|
384
|
+
return callback(err);
|
|
385
|
+
const assets = compilation.getAssets();
|
|
386
|
+
compilation.assets = Object.assign({}, compilation.assets);
|
|
387
|
+
const caseInsensitiveMap = new Map();
|
|
388
|
+
const allTargetPaths = new Set();
|
|
389
|
+
neo_async_1.default.forEachLimit(assets, 15, ({ name: file, source, info }, callback) => {
|
|
390
|
+
let targetFile = file;
|
|
391
|
+
let immutable = info.immutable;
|
|
392
|
+
const queryStringIdx = targetFile.indexOf('?');
|
|
393
|
+
if (queryStringIdx >= 0) {
|
|
394
|
+
targetFile = targetFile.slice(0, queryStringIdx);
|
|
395
|
+
// We may remove the hash, which is in the query string
|
|
396
|
+
// So we recheck if the file is immutable
|
|
397
|
+
// This doesn't cover all cases, but immutable is only a performance optimization anyway
|
|
398
|
+
immutable =
|
|
399
|
+
immutable &&
|
|
400
|
+
(includesHash(targetFile, info.contenthash) ||
|
|
401
|
+
includesHash(targetFile, info.chunkhash) ||
|
|
402
|
+
includesHash(targetFile, info.modulehash) ||
|
|
403
|
+
includesHash(targetFile, info.fullhash));
|
|
404
|
+
}
|
|
405
|
+
const writeOut = (err) => {
|
|
406
|
+
if (err)
|
|
407
|
+
return callback(err);
|
|
408
|
+
const targetPath = (0, fs_1.join)(this.outputFileSystem, outputPath, targetFile);
|
|
409
|
+
allTargetPaths.add(targetPath);
|
|
410
|
+
// check if the target file has already been written by this Compiler
|
|
411
|
+
const targetFileGeneration = this._assetEmittingWrittenFiles.get(targetPath);
|
|
412
|
+
// create an cache entry for this Source if not already existing
|
|
413
|
+
let cacheEntry = this._assetEmittingSourceCache.get(source);
|
|
414
|
+
if (cacheEntry === undefined) {
|
|
415
|
+
cacheEntry = {
|
|
416
|
+
sizeOnlySource: undefined,
|
|
417
|
+
writtenTo: new Map(),
|
|
418
|
+
};
|
|
419
|
+
this._assetEmittingSourceCache.set(source, cacheEntry);
|
|
420
|
+
}
|
|
421
|
+
let similarEntry;
|
|
422
|
+
const checkSimilarFile = () => {
|
|
423
|
+
const caseInsensitiveTargetPath = targetPath.toLowerCase();
|
|
424
|
+
similarEntry = caseInsensitiveMap.get(caseInsensitiveTargetPath);
|
|
425
|
+
if (similarEntry !== undefined) {
|
|
426
|
+
const { path: other, source: otherSource } = similarEntry;
|
|
427
|
+
if ((0, source_1.isSourceEqual)(otherSource, source)) {
|
|
428
|
+
// Size may or may not be available at this point.
|
|
429
|
+
// If it's not available add to "waiting" list and it will be updated once available
|
|
430
|
+
if (similarEntry.size !== undefined) {
|
|
431
|
+
updateWithReplacementSource(similarEntry.size);
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
if (!similarEntry.waiting)
|
|
435
|
+
similarEntry.waiting = [];
|
|
436
|
+
similarEntry.waiting.push({ file, cacheEntry });
|
|
437
|
+
}
|
|
438
|
+
alreadyWritten();
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
const err = new BaseError_1.default(`Prevent writing to file that only differs in casing or query string from already written file.
|
|
442
|
+
This will lead to a race-condition and corrupted files on case-insensitive file systems.
|
|
443
|
+
${targetPath}
|
|
444
|
+
${other}`);
|
|
445
|
+
err.file = file;
|
|
446
|
+
callback(err);
|
|
447
|
+
}
|
|
448
|
+
return true;
|
|
449
|
+
}
|
|
450
|
+
caseInsensitiveMap.set(caseInsensitiveTargetPath, (similarEntry = {
|
|
451
|
+
path: targetPath,
|
|
452
|
+
source,
|
|
453
|
+
size: undefined,
|
|
454
|
+
waiting: undefined,
|
|
455
|
+
}));
|
|
456
|
+
return false;
|
|
457
|
+
};
|
|
458
|
+
const getContent = () => {
|
|
459
|
+
if (typeof source.buffer === 'function') {
|
|
460
|
+
return source.buffer();
|
|
461
|
+
}
|
|
462
|
+
const bufferOrString = source.source();
|
|
463
|
+
if (Buffer.isBuffer(bufferOrString)) {
|
|
464
|
+
return bufferOrString;
|
|
465
|
+
}
|
|
466
|
+
return Buffer.from(bufferOrString, 'utf8');
|
|
467
|
+
};
|
|
468
|
+
const alreadyWritten = () => {
|
|
469
|
+
// cache the information that the Source has been already been written to that location
|
|
470
|
+
if (targetFileGeneration === undefined) {
|
|
471
|
+
const newGeneration = 1;
|
|
472
|
+
this._assetEmittingWrittenFiles.set(targetPath, newGeneration);
|
|
473
|
+
cacheEntry.writtenTo.set(targetPath, newGeneration);
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
cacheEntry.writtenTo.set(targetPath, targetFileGeneration);
|
|
477
|
+
}
|
|
478
|
+
callback();
|
|
479
|
+
};
|
|
480
|
+
const doWrite = content => {
|
|
481
|
+
this.outputFileSystem.writeFile(targetPath, content, err => {
|
|
482
|
+
if (err)
|
|
483
|
+
return callback(err);
|
|
484
|
+
// information marker that the asset has been emitted
|
|
485
|
+
compilation.emittedAssets.add(file);
|
|
486
|
+
// cache the information that the Source has been written to that location
|
|
487
|
+
const newGeneration = targetFileGeneration === undefined ? 1 : targetFileGeneration + 1;
|
|
488
|
+
cacheEntry.writtenTo.set(targetPath, newGeneration);
|
|
489
|
+
this._assetEmittingWrittenFiles.set(targetPath, newGeneration);
|
|
490
|
+
this.hooks.assetEmitted.callAsync(file, {
|
|
491
|
+
content,
|
|
492
|
+
source,
|
|
493
|
+
outputPath,
|
|
494
|
+
compilation,
|
|
495
|
+
targetPath,
|
|
496
|
+
}, callback);
|
|
497
|
+
});
|
|
498
|
+
};
|
|
499
|
+
const updateWithReplacementSource = size => {
|
|
500
|
+
updateFileWithReplacementSource(file, cacheEntry, size);
|
|
501
|
+
similarEntry.size = size;
|
|
502
|
+
if (similarEntry.waiting !== undefined) {
|
|
503
|
+
for (const { file, cacheEntry } of similarEntry.waiting) {
|
|
504
|
+
updateFileWithReplacementSource(file, cacheEntry, size);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
const updateFileWithReplacementSource = (file, cacheEntry, size) => {
|
|
509
|
+
// Create a replacement resource which only allows to ask for size
|
|
510
|
+
// This allows to GC all memory allocated by the Source
|
|
511
|
+
// (expect when the Source is stored in any other cache)
|
|
512
|
+
if (!cacheEntry.sizeOnlySource) {
|
|
513
|
+
cacheEntry.sizeOnlySource = new webpack_sources_1.SizeOnlySource(size);
|
|
514
|
+
}
|
|
515
|
+
compilation.updateAsset(file, cacheEntry.sizeOnlySource, {
|
|
516
|
+
size,
|
|
517
|
+
});
|
|
518
|
+
};
|
|
519
|
+
const processExistingFile = stats => {
|
|
520
|
+
// skip emitting if it's already there and an immutable file
|
|
521
|
+
if (immutable) {
|
|
522
|
+
updateWithReplacementSource(stats.size);
|
|
523
|
+
return alreadyWritten();
|
|
524
|
+
}
|
|
525
|
+
const content = getContent();
|
|
526
|
+
updateWithReplacementSource(content.length);
|
|
527
|
+
// if it exists and content on disk matches content
|
|
528
|
+
// skip writing the same content again
|
|
529
|
+
// (to keep mtime and don't trigger watchers)
|
|
530
|
+
// for a fast negative match file size is compared first
|
|
531
|
+
if (content.length === stats.size) {
|
|
532
|
+
compilation.comparedForEmitAssets.add(file);
|
|
533
|
+
return this.outputFileSystem.readFile(targetPath, (err, existingContent) => {
|
|
534
|
+
if (err || !content.equals(existingContent)) {
|
|
535
|
+
return doWrite(content);
|
|
536
|
+
}
|
|
537
|
+
return alreadyWritten();
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
return doWrite(content);
|
|
541
|
+
};
|
|
542
|
+
const processMissingFile = () => {
|
|
543
|
+
const content = getContent();
|
|
544
|
+
updateWithReplacementSource(content.length);
|
|
545
|
+
return doWrite(content);
|
|
546
|
+
};
|
|
547
|
+
// if the target file has already been written
|
|
548
|
+
if (targetFileGeneration !== undefined) {
|
|
549
|
+
// check if the Source has been written to this target file
|
|
550
|
+
const writtenGeneration = cacheEntry.writtenTo.get(targetPath);
|
|
551
|
+
if (writtenGeneration === targetFileGeneration) {
|
|
552
|
+
// if yes, we may skip writing the file
|
|
553
|
+
// if it's already there
|
|
554
|
+
// (we assume one doesn't modify files while the Compiler is running, other then removing them)
|
|
555
|
+
if (this._assetEmittingPreviousFiles.has(targetPath)) {
|
|
556
|
+
// We assume that assets from the last compilation say intact on disk (they are not removed)
|
|
557
|
+
compilation.updateAsset(file, cacheEntry.sizeOnlySource, {
|
|
558
|
+
size: cacheEntry.sizeOnlySource.size(),
|
|
559
|
+
});
|
|
560
|
+
return callback();
|
|
561
|
+
}
|
|
562
|
+
// Settings immutable will make it accept file content without comparing when file exist
|
|
563
|
+
immutable = true;
|
|
564
|
+
}
|
|
565
|
+
else if (!immutable) {
|
|
566
|
+
if (checkSimilarFile())
|
|
567
|
+
return;
|
|
568
|
+
// We wrote to this file before which has very likely a different content
|
|
569
|
+
// skip comparing and assume content is different for performance
|
|
570
|
+
// This case happens often during watch mode.
|
|
571
|
+
return processMissingFile();
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
if (checkSimilarFile())
|
|
575
|
+
return;
|
|
576
|
+
if (this.options.output.compareBeforeEmit) {
|
|
577
|
+
this.outputFileSystem.stat(targetPath, (err, stats) => {
|
|
578
|
+
const exists = !err && stats.isFile();
|
|
579
|
+
if (exists) {
|
|
580
|
+
processExistingFile(stats);
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
processMissingFile();
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
processMissingFile();
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
if (targetFile.match(/\/|\\/)) {
|
|
592
|
+
const fs = this.outputFileSystem;
|
|
593
|
+
const dir = (0, fs_1.dirname)(fs, (0, fs_1.join)(fs, outputPath, targetFile));
|
|
594
|
+
(0, fs_1.mkdirp)(fs, dir, writeOut);
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
writeOut();
|
|
598
|
+
}
|
|
599
|
+
}, err => {
|
|
600
|
+
// Clear map to free up memory
|
|
601
|
+
caseInsensitiveMap.clear();
|
|
602
|
+
if (err) {
|
|
603
|
+
this._assetEmittingPreviousFiles.clear();
|
|
604
|
+
return callback(err);
|
|
605
|
+
}
|
|
606
|
+
this._assetEmittingPreviousFiles = allTargetPaths;
|
|
607
|
+
this.hooks.afterEmit.callAsync(compilation, err => {
|
|
608
|
+
if (err)
|
|
609
|
+
return callback(err);
|
|
610
|
+
return callback();
|
|
611
|
+
});
|
|
612
|
+
});
|
|
613
|
+
};
|
|
614
|
+
this.hooks.emit.callAsync(compilation, err => {
|
|
615
|
+
if (err)
|
|
616
|
+
return callback(err);
|
|
617
|
+
outputPath = compilation.getPath(this.outputPath, {});
|
|
618
|
+
(0, fs_1.mkdirp)(this.outputFileSystem, outputPath, emitFiles);
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
emitRecords(callback) {
|
|
622
|
+
if (this.hooks.emitRecords.isUsed()) {
|
|
623
|
+
if (this.recordsOutputPath) {
|
|
624
|
+
neo_async_1.default.parallel([cb => this.hooks.emitRecords.callAsync(cb), this._emitRecords.bind(this)], err => callback(err));
|
|
625
|
+
}
|
|
626
|
+
else {
|
|
627
|
+
this.hooks.emitRecords.callAsync(callback);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
else if (this.recordsOutputPath) {
|
|
631
|
+
this._emitRecords(callback);
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
callback();
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
_emitRecords(callback) {
|
|
638
|
+
const writeFile = () => {
|
|
639
|
+
this.outputFileSystem.writeFile(this.recordsOutputPath, JSON.stringify(this.records, (n, value) => {
|
|
640
|
+
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
641
|
+
const keys = Object.keys(value);
|
|
642
|
+
if (!isSorted(keys)) {
|
|
643
|
+
return sortObject(value, keys);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return value;
|
|
647
|
+
}, 2), callback);
|
|
648
|
+
};
|
|
649
|
+
const recordsOutputPathDirectory = (0, fs_1.dirname)(this.outputFileSystem, this.recordsOutputPath);
|
|
650
|
+
if (!recordsOutputPathDirectory) {
|
|
651
|
+
return writeFile();
|
|
652
|
+
}
|
|
653
|
+
(0, fs_1.mkdirp)(this.outputFileSystem, recordsOutputPathDirectory, err => {
|
|
654
|
+
if (err)
|
|
655
|
+
return callback(err);
|
|
656
|
+
writeFile();
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
readRecords(callback) {
|
|
660
|
+
if (this.hooks.readRecords.isUsed()) {
|
|
661
|
+
if (this.recordsInputPath) {
|
|
662
|
+
neo_async_1.default.parallel([cb => this.hooks.readRecords.callAsync(cb), this._readRecords.bind(this)], err => callback(err));
|
|
663
|
+
}
|
|
664
|
+
else {
|
|
665
|
+
this.records = {};
|
|
666
|
+
this.hooks.readRecords.callAsync(callback);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
else if (this.recordsInputPath) {
|
|
670
|
+
this._readRecords(callback);
|
|
671
|
+
}
|
|
672
|
+
else {
|
|
673
|
+
this.records = {};
|
|
674
|
+
callback();
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
_readRecords(callback) {
|
|
678
|
+
if (!this.recordsInputPath) {
|
|
679
|
+
this.records = {};
|
|
680
|
+
return callback();
|
|
681
|
+
}
|
|
682
|
+
this.inputFileSystem.stat(this.recordsInputPath, err => {
|
|
683
|
+
// It doesn't exist
|
|
684
|
+
// We can ignore this.
|
|
685
|
+
if (err)
|
|
686
|
+
return callback();
|
|
687
|
+
this.inputFileSystem.readFile(this.recordsInputPath, (err, content) => {
|
|
688
|
+
if (err)
|
|
689
|
+
return callback(err);
|
|
690
|
+
try {
|
|
691
|
+
this.records = (0, json_parse_even_better_errors_1.default)(content.toString('utf-8'));
|
|
692
|
+
}
|
|
693
|
+
catch (e) {
|
|
694
|
+
return callback(new Error(`Cannot parse records: ${e.message}`));
|
|
695
|
+
}
|
|
696
|
+
return callback();
|
|
697
|
+
});
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
createChildCompiler(compilation, compilerName, compilerIndex, outputOptions, plugins) {
|
|
701
|
+
const childCompiler = new Compiler(this.project, this.packSetting, Object.assign(Object.assign({}, this.options), { output: Object.assign(Object.assign({}, this.options.output), outputOptions) }));
|
|
702
|
+
childCompiler.name = compilerName;
|
|
703
|
+
childCompiler.outputPath = this.outputPath;
|
|
704
|
+
childCompiler.inputFileSystem = this.inputFileSystem;
|
|
705
|
+
childCompiler.outputFileSystem = null;
|
|
706
|
+
childCompiler.resolverFactory = this.resolverFactory;
|
|
707
|
+
childCompiler.modifiedFiles = this.modifiedFiles;
|
|
708
|
+
childCompiler.removedFiles = this.removedFiles;
|
|
709
|
+
childCompiler.fileTimestamps = this.fileTimestamps;
|
|
710
|
+
childCompiler.contextTimestamps = this.contextTimestamps;
|
|
711
|
+
childCompiler.fsStartTime = this.fsStartTime;
|
|
712
|
+
childCompiler.cache = this.cache;
|
|
713
|
+
childCompiler.compilerPath = `${this.compilerPath}${compilerName}|${compilerIndex}|`;
|
|
714
|
+
const relativeCompilerName = (0, identifier_1.makePathsRelative)(this.context, compilerName, this.root);
|
|
715
|
+
if (!this.records[relativeCompilerName]) {
|
|
716
|
+
this.records[relativeCompilerName] = [];
|
|
717
|
+
}
|
|
718
|
+
if (this.records[relativeCompilerName][compilerIndex]) {
|
|
719
|
+
childCompiler.records = this.records[relativeCompilerName][compilerIndex];
|
|
720
|
+
}
|
|
721
|
+
else {
|
|
722
|
+
this.records[relativeCompilerName].push((childCompiler.records = {}));
|
|
723
|
+
}
|
|
724
|
+
childCompiler.parentCompilation = compilation;
|
|
725
|
+
childCompiler.root = this.root;
|
|
726
|
+
if (Array.isArray(plugins)) {
|
|
727
|
+
for (const plugin of plugins) {
|
|
728
|
+
if (plugin) {
|
|
729
|
+
plugin.apply(childCompiler);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
for (const name in this.hooks) {
|
|
734
|
+
if (!['make', 'compile', 'emit', 'afterEmit', 'invalid', 'done', 'thisCompilation'].includes(name)) {
|
|
735
|
+
if (childCompiler.hooks[name]) {
|
|
736
|
+
childCompiler.hooks[name].taps = this.hooks[name].taps.slice();
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
compilation.hooks.childCompiler.call(childCompiler, compilerName, compilerIndex);
|
|
741
|
+
return childCompiler;
|
|
742
|
+
}
|
|
743
|
+
isChild() {
|
|
744
|
+
return !!this.parentCompilation;
|
|
745
|
+
}
|
|
746
|
+
createCompilation(params) {
|
|
747
|
+
this._cleanupLastCompilation();
|
|
748
|
+
this._lastCompilation = new Compilation_1.default(this, params);
|
|
749
|
+
return this._lastCompilation;
|
|
750
|
+
}
|
|
751
|
+
newCompilation(params) {
|
|
752
|
+
const compilation = this.createCompilation(params);
|
|
753
|
+
compilation.name = this.name;
|
|
754
|
+
compilation.records = this.records;
|
|
755
|
+
this.hooks.thisCompilation.call(compilation, params);
|
|
756
|
+
this.hooks.compilation.call(compilation, params);
|
|
757
|
+
return compilation;
|
|
758
|
+
}
|
|
759
|
+
createNormalModuleFactory() {
|
|
760
|
+
this._cleanupLastNormalModuleFactory();
|
|
761
|
+
const normalModuleFactory = new NormalModuleFactory_1.default({
|
|
762
|
+
context: this.options.context,
|
|
763
|
+
fs: this.inputFileSystem,
|
|
764
|
+
resolverFactory: this.resolverFactory,
|
|
765
|
+
options: this.options.module,
|
|
766
|
+
associatedObjectForCache: this.root,
|
|
767
|
+
layers: this.options.experiments.layers,
|
|
768
|
+
});
|
|
769
|
+
this._lastNormalModuleFactory = normalModuleFactory;
|
|
770
|
+
this.hooks.normalModuleFactory.call(normalModuleFactory);
|
|
771
|
+
return normalModuleFactory;
|
|
772
|
+
}
|
|
773
|
+
createContextModuleFactory() {
|
|
774
|
+
const contextModuleFactory = new ContextModuleFactory_1.default(this.resolverFactory);
|
|
775
|
+
this.hooks.contextModuleFactory.call(contextModuleFactory);
|
|
776
|
+
return contextModuleFactory;
|
|
777
|
+
}
|
|
778
|
+
newCompilationParams() {
|
|
779
|
+
const params = {
|
|
780
|
+
normalModuleFactory: this.createNormalModuleFactory(),
|
|
781
|
+
contextModuleFactory: this.createContextModuleFactory(),
|
|
782
|
+
};
|
|
783
|
+
return params;
|
|
784
|
+
}
|
|
785
|
+
compile(callback) {
|
|
786
|
+
const params = this.newCompilationParams();
|
|
787
|
+
this.hooks.beforeCompile.callAsync(params, err => {
|
|
788
|
+
if (err)
|
|
789
|
+
return callback(err);
|
|
790
|
+
this.hooks.compile.call(params);
|
|
791
|
+
const compilation = this.newCompilation(params);
|
|
792
|
+
const logger = compilation.getLogger('webpack.Compiler');
|
|
793
|
+
logger.time('make hook');
|
|
794
|
+
this.hooks.make.callAsync(compilation, err => {
|
|
795
|
+
logger.timeEnd('make hook');
|
|
796
|
+
if (err)
|
|
797
|
+
return callback(err);
|
|
798
|
+
logger.time('finish make hook');
|
|
799
|
+
this.hooks.finishMake.callAsync(compilation, err => {
|
|
800
|
+
logger.timeEnd('finish make hook');
|
|
801
|
+
if (err)
|
|
802
|
+
return callback(err);
|
|
803
|
+
process.nextTick(() => {
|
|
804
|
+
logger.time('finish compilation');
|
|
805
|
+
compilation.finish(err => {
|
|
806
|
+
logger.timeEnd('finish compilation');
|
|
807
|
+
if (err)
|
|
808
|
+
return callback(err);
|
|
809
|
+
logger.time('seal compilation');
|
|
810
|
+
compilation.seal(err => {
|
|
811
|
+
logger.timeEnd('seal compilation');
|
|
812
|
+
if (err)
|
|
813
|
+
return callback(err);
|
|
814
|
+
logger.time('afterCompile hook');
|
|
815
|
+
this.hooks.afterCompile.callAsync(compilation, err => {
|
|
816
|
+
logger.timeEnd('afterCompile hook');
|
|
817
|
+
if (err)
|
|
818
|
+
return callback(err);
|
|
819
|
+
return callback(null, compilation);
|
|
820
|
+
});
|
|
821
|
+
});
|
|
822
|
+
});
|
|
823
|
+
});
|
|
824
|
+
});
|
|
825
|
+
});
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
close(callback) {
|
|
829
|
+
if (this.watching) {
|
|
830
|
+
// When there is still an active watching, close this first
|
|
831
|
+
this.watching.close(err => {
|
|
832
|
+
this.close(callback);
|
|
833
|
+
});
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
this.hooks.shutdown.callAsync(err => {
|
|
837
|
+
if (err)
|
|
838
|
+
return callback(err);
|
|
839
|
+
this._lastCompilation = undefined;
|
|
840
|
+
this._lastNormalModuleFactory = undefined;
|
|
841
|
+
this.cache.shutdown(callback);
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
exports.default = Compiler;
|