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,780 @@
|
|
|
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 MiniCssUtils_1 = require("./MiniCssUtils");
|
|
30
|
+
const Serialization_1 = __importDefault(require("@/serialization/Serialization"));
|
|
31
|
+
const NormalModule_1 = __importDefault(require("@/module/NormalModule"));
|
|
32
|
+
const Module_1 = __importDefault(require("@/module/Module"));
|
|
33
|
+
const createHash_1 = __importDefault(require("@/base/createHash"));
|
|
34
|
+
const Dependency_1 = __importDefault(require("@/dependencies/Dependency"));
|
|
35
|
+
const ModuleGraphConnection_1 = require("@/module/ModuleGraphConnection");
|
|
36
|
+
const RuntimeModule_1 = __importDefault(require("@/module/RuntimeModule"));
|
|
37
|
+
const RuntimeGlobals = __importStar(require("@/module/RuntimeGlobals"));
|
|
38
|
+
const Template_1 = require("@/template/Template");
|
|
39
|
+
const GetChunkFilenameRuntimeModule_1 = __importDefault(require("@/module/runtime/GetChunkFilenameRuntimeModule"));
|
|
40
|
+
const webpack_sources_1 = require("webpack-sources");
|
|
41
|
+
const path_1 = __importDefault(require("path"));
|
|
42
|
+
const pluginName = 'mini-css-extract-plugin';
|
|
43
|
+
const pluginSymbol = Symbol(pluginName);
|
|
44
|
+
const DEFAULT_FILENAME = '[name].css';
|
|
45
|
+
const TYPES = new Set([MiniCssUtils_1.MODULE_TYPE]);
|
|
46
|
+
const CODE_GENERATION_RESULT = {
|
|
47
|
+
sources: new Map(),
|
|
48
|
+
runtimeRequirements: new Set(),
|
|
49
|
+
};
|
|
50
|
+
const cssModuleCache = new WeakMap();
|
|
51
|
+
const cssDependencyCache = new WeakMap();
|
|
52
|
+
const registered = new WeakSet();
|
|
53
|
+
class MiniCssExtractPlugin {
|
|
54
|
+
static getCssModule(indentifier) {
|
|
55
|
+
if (cssModuleCache.has(indentifier)) {
|
|
56
|
+
return cssModuleCache.get(indentifier);
|
|
57
|
+
}
|
|
58
|
+
class CssModule extends Module_1.default {
|
|
59
|
+
constructor({ context, identifier, identifierIndex, content, layer, supports, media, sourceMap, assets, assetsInfo, }) {
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
super(MiniCssUtils_1.MODULE_TYPE, context);
|
|
62
|
+
this.id = '';
|
|
63
|
+
this._context = context;
|
|
64
|
+
this._identifier = identifier;
|
|
65
|
+
this._identifierIndex = identifierIndex;
|
|
66
|
+
this.content = content;
|
|
67
|
+
this.layer = layer;
|
|
68
|
+
this.supports = supports;
|
|
69
|
+
this.media = media;
|
|
70
|
+
this.sourceMap = sourceMap;
|
|
71
|
+
this.assets = assets;
|
|
72
|
+
this.assetsInfo = assetsInfo;
|
|
73
|
+
this._needBuild = true;
|
|
74
|
+
}
|
|
75
|
+
// no source() so webpack 4 doesn't do add stuff to the bundle
|
|
76
|
+
size() {
|
|
77
|
+
return this.content.length;
|
|
78
|
+
}
|
|
79
|
+
identifier() {
|
|
80
|
+
return `css|${this._identifier}|${this._identifierIndex}|${this.layer || ''}|${this.supports || ''}|${this.media}}}`;
|
|
81
|
+
}
|
|
82
|
+
readableIdentifier(requestShortener) {
|
|
83
|
+
return `css ${requestShortener.shorten(this._identifier)}${this._identifierIndex ? ` (${this._identifierIndex})` : ''}${this.layer ? ` (layer ${this.layer})` : ''}${this.supports ? ` (supports ${this.supports})` : ''}${this.media ? ` (media ${this.media})` : ''}`;
|
|
84
|
+
}
|
|
85
|
+
// eslint-disable-next-line class-methods-use-this
|
|
86
|
+
getSourceTypes() {
|
|
87
|
+
return TYPES;
|
|
88
|
+
}
|
|
89
|
+
// eslint-disable-next-line class-methods-use-this
|
|
90
|
+
codeGeneration() {
|
|
91
|
+
return CODE_GENERATION_RESULT;
|
|
92
|
+
}
|
|
93
|
+
nameForCondition() {
|
|
94
|
+
const resource = this._identifier.split('!').pop();
|
|
95
|
+
const idx = resource.indexOf('?');
|
|
96
|
+
if (idx >= 0) {
|
|
97
|
+
return resource.substring(0, idx);
|
|
98
|
+
}
|
|
99
|
+
return resource;
|
|
100
|
+
}
|
|
101
|
+
updateCacheModule(module) {
|
|
102
|
+
if (!this.content.equals(module.content) ||
|
|
103
|
+
this.layer !== module.layer ||
|
|
104
|
+
this.supports !== module.supports ||
|
|
105
|
+
this.media !== module.media ||
|
|
106
|
+
(this.sourceMap ? !this.sourceMap.equals(module.sourceMap) : false) ||
|
|
107
|
+
this.assets !== module.assets ||
|
|
108
|
+
this.assetsInfo !== module.assetsInfo) {
|
|
109
|
+
this._needBuild = true;
|
|
110
|
+
this.content = module.content;
|
|
111
|
+
this.layer = module.layer;
|
|
112
|
+
this.supports = module.supports;
|
|
113
|
+
this.media = module.media;
|
|
114
|
+
this.sourceMap = module.sourceMap;
|
|
115
|
+
this.assets = module.assets;
|
|
116
|
+
this.assetsInfo = module.assetsInfo;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// eslint-disable-next-line class-methods-use-this
|
|
120
|
+
needRebuild() {
|
|
121
|
+
return this._needBuild;
|
|
122
|
+
}
|
|
123
|
+
needBuild(context, callback) {
|
|
124
|
+
callback(undefined, this._needBuild);
|
|
125
|
+
}
|
|
126
|
+
build(options, compilation, resolver, fileSystem, callback) {
|
|
127
|
+
this.buildInfo = {
|
|
128
|
+
assets: this.assets,
|
|
129
|
+
assetsInfo: this.assetsInfo,
|
|
130
|
+
cacheable: true,
|
|
131
|
+
hash: this._computeHash(compilation.outputOptions.hashFunction),
|
|
132
|
+
};
|
|
133
|
+
this.buildMeta = {};
|
|
134
|
+
this._needBuild = false;
|
|
135
|
+
callback();
|
|
136
|
+
}
|
|
137
|
+
_computeHash(hashFunction) {
|
|
138
|
+
const hash = (0, createHash_1.default)(hashFunction);
|
|
139
|
+
hash.update(this.content);
|
|
140
|
+
if (this.layer) {
|
|
141
|
+
hash.update(this.layer);
|
|
142
|
+
}
|
|
143
|
+
hash.update(this.supports || '');
|
|
144
|
+
hash.update(this.media || '');
|
|
145
|
+
hash.update(this.sourceMap || '');
|
|
146
|
+
return hash.digest('hex');
|
|
147
|
+
}
|
|
148
|
+
updateHash(hash, context) {
|
|
149
|
+
super.updateHash(hash, context);
|
|
150
|
+
hash.update(this.buildInfo.hash);
|
|
151
|
+
}
|
|
152
|
+
serialize(context) {
|
|
153
|
+
const { write } = context;
|
|
154
|
+
write(this._context);
|
|
155
|
+
write(this._identifier);
|
|
156
|
+
write(this._identifierIndex);
|
|
157
|
+
write(this.content);
|
|
158
|
+
write(this.layer);
|
|
159
|
+
write(this.supports);
|
|
160
|
+
write(this.media);
|
|
161
|
+
write(this.sourceMap);
|
|
162
|
+
write(this.assets);
|
|
163
|
+
write(this.assetsInfo);
|
|
164
|
+
write(this._needBuild);
|
|
165
|
+
super.serialize(context);
|
|
166
|
+
}
|
|
167
|
+
deserialize(context) {
|
|
168
|
+
this._needBuild = context.read();
|
|
169
|
+
super.deserialize(context);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
cssModuleCache.set(indentifier, CssModule);
|
|
173
|
+
Serialization_1.default.register(CssModule, path_1.default.resolve(__dirname, 'CssModule'), null, {
|
|
174
|
+
serialize(instance, context) {
|
|
175
|
+
instance.serialize(context);
|
|
176
|
+
},
|
|
177
|
+
deserialize(context) {
|
|
178
|
+
const { read } = context;
|
|
179
|
+
const contextModule = read();
|
|
180
|
+
const identifier = read();
|
|
181
|
+
const identifierIndex = read();
|
|
182
|
+
const content = read();
|
|
183
|
+
const layer = read();
|
|
184
|
+
const supports = read();
|
|
185
|
+
const media = read();
|
|
186
|
+
const sourceMap = read();
|
|
187
|
+
const assets = read();
|
|
188
|
+
const assetsInfo = read();
|
|
189
|
+
const dep = new CssModule({
|
|
190
|
+
context: contextModule,
|
|
191
|
+
identifier,
|
|
192
|
+
identifierIndex,
|
|
193
|
+
content,
|
|
194
|
+
layer,
|
|
195
|
+
supports,
|
|
196
|
+
media,
|
|
197
|
+
sourceMap,
|
|
198
|
+
assets,
|
|
199
|
+
assetsInfo,
|
|
200
|
+
});
|
|
201
|
+
dep.deserialize(context);
|
|
202
|
+
return dep;
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
return CssModule;
|
|
206
|
+
}
|
|
207
|
+
static getCssDependency(indentifier) {
|
|
208
|
+
if (cssDependencyCache.has(indentifier)) {
|
|
209
|
+
return cssDependencyCache.get(indentifier);
|
|
210
|
+
}
|
|
211
|
+
class CssDependency extends Dependency_1.default {
|
|
212
|
+
constructor({ identifier, content, layer, supports, media, sourceMap }, context, identifierIndex) {
|
|
213
|
+
super();
|
|
214
|
+
this.identifier = identifier;
|
|
215
|
+
this.identifierIndex = identifierIndex;
|
|
216
|
+
this.content = content;
|
|
217
|
+
this.layer = layer;
|
|
218
|
+
this.supports = supports;
|
|
219
|
+
this.media = media;
|
|
220
|
+
this.sourceMap = sourceMap;
|
|
221
|
+
this.context = context;
|
|
222
|
+
this.assets = undefined;
|
|
223
|
+
this.assetsInfo = undefined;
|
|
224
|
+
}
|
|
225
|
+
getResourceIdentifier() {
|
|
226
|
+
return `css-module-${this.identifier}-${this.identifierIndex}`;
|
|
227
|
+
}
|
|
228
|
+
// eslint-disable-next-line class-methods-use-this
|
|
229
|
+
getModuleEvaluationSideEffectsState() {
|
|
230
|
+
return ModuleGraphConnection_1.TRANSITIVE_ONLY;
|
|
231
|
+
}
|
|
232
|
+
serialize(context) {
|
|
233
|
+
const { write } = context;
|
|
234
|
+
write(this.identifier);
|
|
235
|
+
write(this.content);
|
|
236
|
+
write(this.layer);
|
|
237
|
+
write(this.supports);
|
|
238
|
+
write(this.media);
|
|
239
|
+
write(this.sourceMap);
|
|
240
|
+
write(this.context);
|
|
241
|
+
write(this.identifierIndex);
|
|
242
|
+
write(this.assets);
|
|
243
|
+
write(this.assetsInfo);
|
|
244
|
+
super.serialize(context);
|
|
245
|
+
}
|
|
246
|
+
deserialize(context) {
|
|
247
|
+
super.deserialize(context);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
cssDependencyCache.set(indentifier, CssDependency);
|
|
251
|
+
Serialization_1.default.register(CssDependency, path_1.default.resolve(__dirname, 'CssDependency'),
|
|
252
|
+
// @ts-ignore
|
|
253
|
+
null, {
|
|
254
|
+
serialize(instance, context) {
|
|
255
|
+
instance.serialize(context);
|
|
256
|
+
},
|
|
257
|
+
deserialize(context) {
|
|
258
|
+
const { read } = context;
|
|
259
|
+
const dep = new CssDependency({
|
|
260
|
+
identifier: read(),
|
|
261
|
+
content: read(),
|
|
262
|
+
layer: read(),
|
|
263
|
+
supports: read(),
|
|
264
|
+
media: read(),
|
|
265
|
+
sourceMap: read(),
|
|
266
|
+
}, read(), read());
|
|
267
|
+
const assets = read();
|
|
268
|
+
const assetsInfo = read();
|
|
269
|
+
dep.assets = assets;
|
|
270
|
+
dep.assetsInfo = assetsInfo;
|
|
271
|
+
dep.deserialize(context);
|
|
272
|
+
return dep;
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
return CssDependency;
|
|
276
|
+
}
|
|
277
|
+
constructor(options = {}) {
|
|
278
|
+
this._sortedModulesCache = new WeakMap();
|
|
279
|
+
this.options = Object.assign({ filename: DEFAULT_FILENAME, ignoreOrder: false,
|
|
280
|
+
// TODO remove in the next major release
|
|
281
|
+
// eslint-disable-next-line no-undefined
|
|
282
|
+
experimentalUseImportModule: undefined, runtime: true }, options);
|
|
283
|
+
this.runtimeOptions = {
|
|
284
|
+
insert: options.insert,
|
|
285
|
+
linkType:
|
|
286
|
+
// Todo in next major release set default to "false"
|
|
287
|
+
(typeof options.linkType === 'boolean' && options.linkType === true) ||
|
|
288
|
+
typeof options.linkType === 'undefined'
|
|
289
|
+
? 'text/css'
|
|
290
|
+
: options.linkType,
|
|
291
|
+
attributes: options.attributes,
|
|
292
|
+
};
|
|
293
|
+
if (!this.options.chunkFilename) {
|
|
294
|
+
const { filename } = this.options;
|
|
295
|
+
if (typeof filename !== 'function') {
|
|
296
|
+
const hasName = filename.includes('[name]');
|
|
297
|
+
const hasId = filename.includes('[id]');
|
|
298
|
+
const hasChunkHash = filename.includes('[chunkhash]');
|
|
299
|
+
const hasContentHash = filename.includes('[contenthash]');
|
|
300
|
+
// Anything changing depending on chunk is fine
|
|
301
|
+
if (hasChunkHash || hasContentHash || hasName || hasId) {
|
|
302
|
+
this.options.chunkFilename = filename;
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
// Otherwise prefix "[id]." in front of the basename to make it changing
|
|
306
|
+
this.options.chunkFilename = filename.replace(/(^|\/)([^/]*(?:\?|$))/, '$1[id].$2');
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
this.options.chunkFilename = '[id].css';
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
apply(compiler) {
|
|
315
|
+
if (this.options.experimentalUseImportModule) {
|
|
316
|
+
if (typeof compiler.options.experiments.executeModule === 'undefined') {
|
|
317
|
+
compiler.options.experiments.executeModule = true;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
const { MPPack } = compiler;
|
|
321
|
+
if (!registered.has(MPPack)) {
|
|
322
|
+
registered.add(MPPack);
|
|
323
|
+
Serialization_1.default.registerLoader(/^mini-css-extract-plugin\//, MiniCssUtils_1.trueFn);
|
|
324
|
+
}
|
|
325
|
+
const { splitChunks } = compiler.options.optimization;
|
|
326
|
+
if (splitChunks) {
|
|
327
|
+
if (splitChunks.defaultSizeTypes.includes('...')) {
|
|
328
|
+
splitChunks.defaultSizeTypes.push(MiniCssUtils_1.MODULE_TYPE);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
const CssModule = MiniCssExtractPlugin.getCssModule(MPPack);
|
|
332
|
+
const CssDependency = MiniCssExtractPlugin.getCssDependency(MPPack);
|
|
333
|
+
compiler.hooks.compilation.tap(pluginName, compilation => {
|
|
334
|
+
const { loader: normalModuleHook } = NormalModule_1.default.getCompilationHooks(compilation);
|
|
335
|
+
normalModuleHook.tap(pluginName, loaderContext => {
|
|
336
|
+
loaderContext[pluginSymbol] = {
|
|
337
|
+
experimentalUseImportModule: this.options.experimentalUseImportModule,
|
|
338
|
+
};
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
compiler.hooks.thisCompilation.tap(pluginName, compilation => {
|
|
342
|
+
class CssModuleFactory {
|
|
343
|
+
create({ dependencies: [dependency] }, callback) {
|
|
344
|
+
callback(
|
|
345
|
+
// eslint-disable-next-line no-undefined
|
|
346
|
+
undefined, new CssModule(dependency));
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
compilation.dependencyFactories.set(CssDependency, new CssModuleFactory());
|
|
350
|
+
class CssDependencyTemplate {
|
|
351
|
+
apply() { }
|
|
352
|
+
}
|
|
353
|
+
compilation.dependencyTemplates.set(CssDependency, new CssDependencyTemplate());
|
|
354
|
+
compilation.hooks.renderManifest.tap(pluginName, (result, { chunk }) => {
|
|
355
|
+
const { chunkGraph } = compilation;
|
|
356
|
+
const renderedModules = Array.from(this.getChunkModules(chunk, chunkGraph)).filter(module =>
|
|
357
|
+
// @ts-ignore
|
|
358
|
+
module.type === MiniCssUtils_1.MODULE_TYPE);
|
|
359
|
+
const filenameTemplate = chunk.canBeInitial()
|
|
360
|
+
? this.options.filename
|
|
361
|
+
: this.options.chunkFilename;
|
|
362
|
+
if (renderedModules.length > 0) {
|
|
363
|
+
result.push({
|
|
364
|
+
render: () => this.renderContentAsset(compiler, compilation, chunk, renderedModules, compilation.runtimeTemplate.requestShortener, filenameTemplate, {
|
|
365
|
+
contentHashType: MiniCssUtils_1.MODULE_TYPE,
|
|
366
|
+
chunk,
|
|
367
|
+
}),
|
|
368
|
+
filenameTemplate,
|
|
369
|
+
pathOptions: {
|
|
370
|
+
chunk,
|
|
371
|
+
contentHashType: MiniCssUtils_1.MODULE_TYPE,
|
|
372
|
+
},
|
|
373
|
+
identifier: `${pluginName}.${chunk.id}`,
|
|
374
|
+
hash: chunk.contentHash[MiniCssUtils_1.MODULE_TYPE],
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
compilation.hooks.contentHash.tap(pluginName, chunk => {
|
|
379
|
+
const { outputOptions, chunkGraph } = compilation;
|
|
380
|
+
const modules = this.sortModules(compilation, chunk, chunkGraph.getChunkModulesIterableBySourceType(chunk, MiniCssUtils_1.MODULE_TYPE), compilation.runtimeTemplate.requestShortener);
|
|
381
|
+
if (modules) {
|
|
382
|
+
const { hashFunction, hashDigest, hashDigestLength } = outputOptions;
|
|
383
|
+
const hash = (0, createHash_1.default)(hashFunction);
|
|
384
|
+
for (const m of modules) {
|
|
385
|
+
hash.update(chunkGraph.getModuleHash(m, chunk.runtime));
|
|
386
|
+
}
|
|
387
|
+
// eslint-disable-next-line no-param-reassign
|
|
388
|
+
chunk.contentHash[MiniCssUtils_1.MODULE_TYPE] = hash.digest(hashDigest).substring(0, hashDigestLength);
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
// All the code below is dedicated to the runtime and can be skipped when the `runtime` option is `false`
|
|
392
|
+
if (!this.options.runtime) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
// eslint-disable-next-line no-shadow
|
|
396
|
+
const getCssChunkObject = (mainChunk, compilation) => {
|
|
397
|
+
const obj = {};
|
|
398
|
+
const { chunkGraph } = compilation;
|
|
399
|
+
for (const chunk of mainChunk.getAllAsyncChunks()) {
|
|
400
|
+
const modules = chunkGraph.getOrderedChunkModulesIterable(chunk, MiniCssUtils_1.compareModulesByIdentifier);
|
|
401
|
+
for (const module of modules) {
|
|
402
|
+
// @ts-ignore
|
|
403
|
+
if (module.type === MiniCssUtils_1.MODULE_TYPE) {
|
|
404
|
+
obj[chunk.id] = 1;
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return obj;
|
|
410
|
+
};
|
|
411
|
+
class CssLoadingRuntimeModule extends RuntimeModule_1.default {
|
|
412
|
+
constructor(runtimeRequirements, runtimeOptions) {
|
|
413
|
+
super('css loading', 10);
|
|
414
|
+
this.runtimeRequirements = runtimeRequirements;
|
|
415
|
+
this.runtimeOptions = runtimeOptions;
|
|
416
|
+
}
|
|
417
|
+
generate() {
|
|
418
|
+
const { chunk, runtimeRequirements } = this;
|
|
419
|
+
const { runtimeTemplate, outputOptions: { crossOriginLoading }, } = this.compilation;
|
|
420
|
+
const chunkMap = getCssChunkObject(chunk, this.compilation);
|
|
421
|
+
const withLoading = runtimeRequirements.has(RuntimeGlobals.ensureChunkHandlers) &&
|
|
422
|
+
Object.keys(chunkMap).length > 0;
|
|
423
|
+
const withHmr = runtimeRequirements.has(RuntimeGlobals.hmrDownloadUpdateHandlers);
|
|
424
|
+
if (!withLoading && !withHmr) {
|
|
425
|
+
return '';
|
|
426
|
+
}
|
|
427
|
+
return Template_1.Template.asString([
|
|
428
|
+
'if (typeof document === "undefined") return;',
|
|
429
|
+
`var createStylesheet = ${runtimeTemplate.basicFunction('chunkId, fullhref, oldTag, resolve, reject', [
|
|
430
|
+
'var linkTag = document.createElement("link");',
|
|
431
|
+
this.runtimeOptions.attributes
|
|
432
|
+
? Template_1.Template.asString(Object.entries(this.runtimeOptions.attributes).map(entry => {
|
|
433
|
+
const [key, value] = entry;
|
|
434
|
+
return `linkTag.setAttribute(${JSON.stringify(key)}, ${JSON.stringify(value)});`;
|
|
435
|
+
}))
|
|
436
|
+
: '',
|
|
437
|
+
'linkTag.rel = "stylesheet";',
|
|
438
|
+
this.runtimeOptions.linkType
|
|
439
|
+
? `linkTag.type = ${JSON.stringify(this.runtimeOptions.linkType)};`
|
|
440
|
+
: '',
|
|
441
|
+
`var onLinkComplete = ${runtimeTemplate.basicFunction('event', [
|
|
442
|
+
'// avoid mem leaks.',
|
|
443
|
+
'linkTag.onerror = linkTag.onload = null;',
|
|
444
|
+
"if (event.type === 'load') {",
|
|
445
|
+
Template_1.Template.indent(['resolve();']),
|
|
446
|
+
'} else {',
|
|
447
|
+
Template_1.Template.indent([
|
|
448
|
+
"var errorType = event && (event.type === 'load' ? 'missing' : event.type);",
|
|
449
|
+
'var realHref = event && event.target && event.target.href || fullhref;',
|
|
450
|
+
'var err = new Error("Loading CSS chunk " + chunkId + " failed.\\n(" + realHref + ")");',
|
|
451
|
+
'err.code = "CSS_CHUNK_LOAD_FAILED";',
|
|
452
|
+
'err.type = errorType;',
|
|
453
|
+
'err.request = realHref;',
|
|
454
|
+
'if (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag)',
|
|
455
|
+
'reject(err);',
|
|
456
|
+
]),
|
|
457
|
+
'}',
|
|
458
|
+
])}`,
|
|
459
|
+
'linkTag.onerror = linkTag.onload = onLinkComplete;',
|
|
460
|
+
'linkTag.href = fullhref;',
|
|
461
|
+
crossOriginLoading
|
|
462
|
+
? Template_1.Template.asString([
|
|
463
|
+
`if (linkTag.href.indexOf(window.location.origin + '/') !== 0) {`,
|
|
464
|
+
Template_1.Template.indent(`linkTag.crossOrigin = ${JSON.stringify(crossOriginLoading)};`),
|
|
465
|
+
'}',
|
|
466
|
+
])
|
|
467
|
+
: '',
|
|
468
|
+
typeof this.runtimeOptions.insert !== 'undefined'
|
|
469
|
+
? typeof this.runtimeOptions.insert === 'function'
|
|
470
|
+
? `(${this.runtimeOptions.insert.toString()})(linkTag)`
|
|
471
|
+
: Template_1.Template.asString([
|
|
472
|
+
`var target = document.querySelector("${this.runtimeOptions.insert}");`,
|
|
473
|
+
`target.parentNode.insertBefore(linkTag, target.nextSibling);`,
|
|
474
|
+
])
|
|
475
|
+
: Template_1.Template.asString([
|
|
476
|
+
'if (oldTag) {',
|
|
477
|
+
Template_1.Template.indent([
|
|
478
|
+
'oldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);',
|
|
479
|
+
]),
|
|
480
|
+
'} else {',
|
|
481
|
+
Template_1.Template.indent(['document.head.appendChild(linkTag);']),
|
|
482
|
+
'}',
|
|
483
|
+
]),
|
|
484
|
+
'return linkTag;',
|
|
485
|
+
])};`,
|
|
486
|
+
`var findStylesheet = ${runtimeTemplate.basicFunction('href, fullhref', [
|
|
487
|
+
'var existingLinkTags = document.getElementsByTagName("link");',
|
|
488
|
+
'for(var i = 0; i < existingLinkTags.length; i++) {',
|
|
489
|
+
Template_1.Template.indent([
|
|
490
|
+
'var tag = existingLinkTags[i];',
|
|
491
|
+
'var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href");',
|
|
492
|
+
'if(tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag;',
|
|
493
|
+
]),
|
|
494
|
+
'}',
|
|
495
|
+
'var existingStyleTags = document.getElementsByTagName("style");',
|
|
496
|
+
'for(var i = 0; i < existingStyleTags.length; i++) {',
|
|
497
|
+
Template_1.Template.indent([
|
|
498
|
+
'var tag = existingStyleTags[i];',
|
|
499
|
+
'var dataHref = tag.getAttribute("data-href");',
|
|
500
|
+
'if(dataHref === href || dataHref === fullhref) return tag;',
|
|
501
|
+
]),
|
|
502
|
+
'}',
|
|
503
|
+
])};`,
|
|
504
|
+
`var loadStylesheet = ${runtimeTemplate.basicFunction('chunkId', `return new Promise(${runtimeTemplate.basicFunction('resolve, reject', [
|
|
505
|
+
`var href = ${RuntimeGlobals.require}.miniCssF(chunkId);`,
|
|
506
|
+
`var fullhref = ${RuntimeGlobals.publicPath} + href;`,
|
|
507
|
+
'if(findStylesheet(href, fullhref)) return resolve();',
|
|
508
|
+
'createStylesheet(chunkId, fullhref, null, resolve, reject);',
|
|
509
|
+
])});`)}`,
|
|
510
|
+
withLoading
|
|
511
|
+
? Template_1.Template.asString([
|
|
512
|
+
'// object to store loaded CSS chunks',
|
|
513
|
+
'var installedCssChunks = {',
|
|
514
|
+
Template_1.Template.indent(chunk.ids.map(id => `${JSON.stringify(id)}: 0`).join(',\n')),
|
|
515
|
+
'};',
|
|
516
|
+
'',
|
|
517
|
+
`${RuntimeGlobals.ensureChunkHandlers}.miniCss = ${runtimeTemplate.basicFunction('chunkId, promises', [
|
|
518
|
+
`var cssChunks = ${JSON.stringify(chunkMap)};`,
|
|
519
|
+
'if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);',
|
|
520
|
+
'else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {',
|
|
521
|
+
Template_1.Template.indent([
|
|
522
|
+
`promises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(${runtimeTemplate.basicFunction('', 'installedCssChunks[chunkId] = 0;')}, ${runtimeTemplate.basicFunction('e', [
|
|
523
|
+
'delete installedCssChunks[chunkId];',
|
|
524
|
+
'throw e;',
|
|
525
|
+
])}));`,
|
|
526
|
+
]),
|
|
527
|
+
'}',
|
|
528
|
+
])};`,
|
|
529
|
+
])
|
|
530
|
+
: '// no chunk loading',
|
|
531
|
+
'',
|
|
532
|
+
withHmr
|
|
533
|
+
? Template_1.Template.asString([
|
|
534
|
+
'var oldTags = [];',
|
|
535
|
+
'var newTags = [];',
|
|
536
|
+
`var applyHandler = ${runtimeTemplate.basicFunction('options', [
|
|
537
|
+
`return { dispose: ${runtimeTemplate.basicFunction('', [
|
|
538
|
+
'for(var i = 0; i < oldTags.length; i++) {',
|
|
539
|
+
Template_1.Template.indent([
|
|
540
|
+
'var oldTag = oldTags[i];',
|
|
541
|
+
'if(oldTag.parentNode) oldTag.parentNode.removeChild(oldTag);',
|
|
542
|
+
]),
|
|
543
|
+
'}',
|
|
544
|
+
'oldTags.length = 0;',
|
|
545
|
+
])}, apply: ${runtimeTemplate.basicFunction('', [
|
|
546
|
+
'for(var i = 0; i < newTags.length; i++) newTags[i].rel = "stylesheet";',
|
|
547
|
+
'newTags.length = 0;',
|
|
548
|
+
])} };`,
|
|
549
|
+
])}`,
|
|
550
|
+
`${RuntimeGlobals.hmrDownloadUpdateHandlers}.miniCss = ${runtimeTemplate.basicFunction('chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList', [
|
|
551
|
+
'applyHandlers.push(applyHandler);',
|
|
552
|
+
`chunkIds.forEach(${runtimeTemplate.basicFunction('chunkId', [
|
|
553
|
+
`var href = ${RuntimeGlobals.require}.miniCssF(chunkId);`,
|
|
554
|
+
`var fullhref = ${RuntimeGlobals.publicPath} + href;`,
|
|
555
|
+
'var oldTag = findStylesheet(href, fullhref);',
|
|
556
|
+
'if(!oldTag) return;',
|
|
557
|
+
`promises.push(new Promise(${runtimeTemplate.basicFunction('resolve, reject', [
|
|
558
|
+
`var tag = createStylesheet(chunkId, fullhref, oldTag, ${runtimeTemplate.basicFunction('', ['tag.as = "style";', 'tag.rel = "preload";', 'resolve();'])}, reject);`,
|
|
559
|
+
'oldTags.push(oldTag);',
|
|
560
|
+
'newTags.push(tag);',
|
|
561
|
+
])}));`,
|
|
562
|
+
])});`,
|
|
563
|
+
])}`,
|
|
564
|
+
])
|
|
565
|
+
: '// no hmr',
|
|
566
|
+
]);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
const enabledChunks = new WeakSet();
|
|
570
|
+
const handler = (chunk, set) => {
|
|
571
|
+
if (enabledChunks.has(chunk)) {
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
enabledChunks.add(chunk);
|
|
575
|
+
if (typeof this.options.chunkFilename === 'string' &&
|
|
576
|
+
/\[(full)?hash(:\d+)?\]/.test(this.options.chunkFilename)) {
|
|
577
|
+
set.add(RuntimeGlobals.getFullHash);
|
|
578
|
+
}
|
|
579
|
+
set.add(RuntimeGlobals.publicPath);
|
|
580
|
+
compilation.addRuntimeModule(chunk, new GetChunkFilenameRuntimeModule_1.default(MiniCssUtils_1.MODULE_TYPE, 'mini-css', `${RuntimeGlobals.require}.miniCssF`, referencedChunk => {
|
|
581
|
+
if (!referencedChunk.contentHash[MiniCssUtils_1.MODULE_TYPE]) {
|
|
582
|
+
return false;
|
|
583
|
+
}
|
|
584
|
+
return referencedChunk.canBeInitial()
|
|
585
|
+
? this.options.filename
|
|
586
|
+
: this.options.chunkFilename;
|
|
587
|
+
}, false));
|
|
588
|
+
compilation.addRuntimeModule(chunk, new CssLoadingRuntimeModule(set, this.runtimeOptions));
|
|
589
|
+
};
|
|
590
|
+
compilation.hooks.runtimeRequirementInTree
|
|
591
|
+
.for(RuntimeGlobals.ensureChunkHandlers)
|
|
592
|
+
.tap(pluginName, handler);
|
|
593
|
+
compilation.hooks.runtimeRequirementInTree
|
|
594
|
+
.for(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
|
595
|
+
.tap(pluginName, handler);
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
getChunkModules(chunk, chunkGraph) {
|
|
599
|
+
return typeof chunkGraph !== 'undefined'
|
|
600
|
+
? chunkGraph.getOrderedChunkModulesIterable(chunk, MiniCssUtils_1.compareModulesByIdentifier)
|
|
601
|
+
: chunk.modulesIterable;
|
|
602
|
+
}
|
|
603
|
+
sortModules(compilation, chunk, modules, requestShortener) {
|
|
604
|
+
let usedModules = this._sortedModulesCache.get(chunk);
|
|
605
|
+
if (usedModules || !modules) {
|
|
606
|
+
return usedModules;
|
|
607
|
+
}
|
|
608
|
+
const modulesList = [...modules];
|
|
609
|
+
// Store dependencies for modules
|
|
610
|
+
const moduleDependencies = new Map(modulesList.map(m => [m, new Set()]));
|
|
611
|
+
const moduleDependenciesReasons = new Map(modulesList.map(m => [m, new Map()]));
|
|
612
|
+
// Get ordered list of modules per chunk group
|
|
613
|
+
// This loop also gathers dependencies from the ordered lists
|
|
614
|
+
// Lists are in reverse order to allow to use Array.pop()
|
|
615
|
+
const modulesByChunkGroup = Array.from(chunk.groupsIterable, (chunkGroup) => {
|
|
616
|
+
const sortedModules = modulesList
|
|
617
|
+
.map(module => ({
|
|
618
|
+
module,
|
|
619
|
+
index: chunkGroup.getModulePostOrderIndex(module),
|
|
620
|
+
}))
|
|
621
|
+
// eslint-disable-next-line no-undefined
|
|
622
|
+
.filter(item => item.index !== undefined)
|
|
623
|
+
.sort((a, b) => b.index - a.index)
|
|
624
|
+
.map(item => item.module);
|
|
625
|
+
for (let i = 0; i < sortedModules.length; i++) {
|
|
626
|
+
const set = moduleDependencies.get(sortedModules[i]);
|
|
627
|
+
const reasons = moduleDependenciesReasons.get(sortedModules[i]);
|
|
628
|
+
for (let j = i + 1; j < sortedModules.length; j++) {
|
|
629
|
+
const module = sortedModules[j];
|
|
630
|
+
set.add(module);
|
|
631
|
+
const reason = reasons.get(module) || new Set();
|
|
632
|
+
reason.add(chunkGroup);
|
|
633
|
+
reasons.set(module, reason);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
return sortedModules;
|
|
637
|
+
});
|
|
638
|
+
// set with already included modules in correct order
|
|
639
|
+
usedModules = new Set();
|
|
640
|
+
const unusedModulesFilter = m => !usedModules.has(m);
|
|
641
|
+
while (usedModules.size < modulesList.length) {
|
|
642
|
+
let success = false;
|
|
643
|
+
let bestMatch;
|
|
644
|
+
let bestMatchDeps;
|
|
645
|
+
// get first module where dependencies are fulfilled
|
|
646
|
+
for (const list of modulesByChunkGroup) {
|
|
647
|
+
// skip and remove already added modules
|
|
648
|
+
while (list.length > 0 && usedModules.has(list[list.length - 1])) {
|
|
649
|
+
list.pop();
|
|
650
|
+
}
|
|
651
|
+
// skip empty lists
|
|
652
|
+
if (list.length !== 0) {
|
|
653
|
+
const module = list[list.length - 1];
|
|
654
|
+
const deps = moduleDependencies.get(module);
|
|
655
|
+
// determine dependencies that are not yet included
|
|
656
|
+
const failedDeps = Array.from(deps).filter(unusedModulesFilter);
|
|
657
|
+
// store best match for fallback behavior
|
|
658
|
+
if (!bestMatchDeps || bestMatchDeps.length > failedDeps.length) {
|
|
659
|
+
bestMatch = list;
|
|
660
|
+
bestMatchDeps = failedDeps;
|
|
661
|
+
}
|
|
662
|
+
if (failedDeps.length === 0) {
|
|
663
|
+
// use this module and remove it from list
|
|
664
|
+
usedModules.add(list.pop());
|
|
665
|
+
success = true;
|
|
666
|
+
break;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
if (!success) {
|
|
671
|
+
// no module found => there is a conflict
|
|
672
|
+
// use list with fewest failed deps
|
|
673
|
+
// and emit a warning
|
|
674
|
+
const fallbackModule = bestMatch.pop();
|
|
675
|
+
if (!this.options.ignoreOrder) {
|
|
676
|
+
const reasons = moduleDependenciesReasons.get(fallbackModule);
|
|
677
|
+
compilation.warnings.push(new Error([
|
|
678
|
+
`chunk ${chunk.name || chunk.id} [${pluginName}]`,
|
|
679
|
+
'Conflicting order. Following module has been added:',
|
|
680
|
+
` * ${fallbackModule.readableIdentifier(requestShortener)}`,
|
|
681
|
+
'despite it was not able to fulfill desired ordering with these modules:',
|
|
682
|
+
...bestMatchDeps.map(m => {
|
|
683
|
+
const goodReasonsMap = moduleDependenciesReasons.get(m);
|
|
684
|
+
const goodReasons = goodReasonsMap === null || goodReasonsMap === void 0 ? void 0 : goodReasonsMap.get(fallbackModule);
|
|
685
|
+
const failedChunkGroups = Array.from(reasons.get(m), (cg) => cg.name).join(', ');
|
|
686
|
+
const goodChunkGroups = goodReasons && Array.from(goodReasons, (cg) => cg.name).join(', ');
|
|
687
|
+
return [
|
|
688
|
+
` * ${m.readableIdentifier(requestShortener)}`,
|
|
689
|
+
` - couldn't fulfill desired order of chunk group(s) ${failedChunkGroups}`,
|
|
690
|
+
goodChunkGroups &&
|
|
691
|
+
` - while fulfilling desired order of chunk group(s) ${goodChunkGroups}`,
|
|
692
|
+
]
|
|
693
|
+
.filter(Boolean)
|
|
694
|
+
.join('\n');
|
|
695
|
+
}),
|
|
696
|
+
].join('\n')));
|
|
697
|
+
}
|
|
698
|
+
usedModules.add(fallbackModule);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
this._sortedModulesCache.set(chunk, usedModules);
|
|
702
|
+
return usedModules;
|
|
703
|
+
}
|
|
704
|
+
renderContentAsset(compiler, compilation, chunk, modules, requestShortener, filenameTemplate, pathData) {
|
|
705
|
+
const usedModules = this.sortModules(compilation, chunk, modules, requestShortener);
|
|
706
|
+
const source = new webpack_sources_1.ConcatSource();
|
|
707
|
+
const externalsSource = new webpack_sources_1.ConcatSource();
|
|
708
|
+
for (const module of usedModules) {
|
|
709
|
+
let content = module.content.toString();
|
|
710
|
+
const readableIdentifier = module.readableIdentifier(requestShortener);
|
|
711
|
+
const startsWithAtRuleImport = /^@import url/.test(content);
|
|
712
|
+
let header;
|
|
713
|
+
if (compilation.outputOptions.pathinfo) {
|
|
714
|
+
const reqStr = readableIdentifier.replace(/\*\//g, '*_/');
|
|
715
|
+
const reqStrStar = '*'.repeat(reqStr.length);
|
|
716
|
+
const headerStr = `/*!****${reqStrStar}****!*\\\n !*** ${reqStr} ***!\n \\****${reqStrStar}****/\n`;
|
|
717
|
+
header = new webpack_sources_1.RawSource(headerStr);
|
|
718
|
+
}
|
|
719
|
+
if (startsWithAtRuleImport) {
|
|
720
|
+
if (typeof header !== 'undefined') {
|
|
721
|
+
externalsSource.add(header);
|
|
722
|
+
}
|
|
723
|
+
// HACK for IE
|
|
724
|
+
// http://stackoverflow.com/a/14676665/1458162
|
|
725
|
+
if (module.media) {
|
|
726
|
+
// insert media into the @import
|
|
727
|
+
// this is rar
|
|
728
|
+
// TODO improve this and parse the CSS to support multiple medias
|
|
729
|
+
content = content.replace(/;|\s*$/, module.media);
|
|
730
|
+
}
|
|
731
|
+
externalsSource.add(content);
|
|
732
|
+
externalsSource.add('\n');
|
|
733
|
+
}
|
|
734
|
+
else {
|
|
735
|
+
if (typeof header !== 'undefined') {
|
|
736
|
+
source.add(header);
|
|
737
|
+
}
|
|
738
|
+
if (module.supports) {
|
|
739
|
+
source.add(`@supports (${module.supports}) {\n`);
|
|
740
|
+
}
|
|
741
|
+
if (module.media) {
|
|
742
|
+
source.add(`@media ${module.media} {\n`);
|
|
743
|
+
}
|
|
744
|
+
const needLayer = typeof module.layer !== 'undefined';
|
|
745
|
+
if (needLayer) {
|
|
746
|
+
source.add(`@layer${module.layer.length > 0 ? ` ${module.layer}` : ''} {\n`);
|
|
747
|
+
}
|
|
748
|
+
const { path: filename } = compilation.getPathWithInfo(filenameTemplate, pathData);
|
|
749
|
+
const undoPath = (0, MiniCssUtils_1.getUndoPath)(filename, compiler.outputPath, false);
|
|
750
|
+
// replacements
|
|
751
|
+
content = content.replace(new RegExp(MiniCssUtils_1.ABSOLUTE_PUBLIC_PATH, 'g'), '');
|
|
752
|
+
content = content.replace(new RegExp(MiniCssUtils_1.SINGLE_DOT_PATH_SEGMENT, 'g'), '.');
|
|
753
|
+
content = content.replace(new RegExp(MiniCssUtils_1.AUTO_PUBLIC_PATH, 'g'), undoPath);
|
|
754
|
+
const entryOptions = chunk.getEntryOptions();
|
|
755
|
+
const baseUriReplacement = (entryOptions === null || entryOptions === void 0 ? void 0 : entryOptions.baseUri) || undoPath;
|
|
756
|
+
content = content.replace(new RegExp(MiniCssUtils_1.BASE_URI, 'g'), baseUriReplacement);
|
|
757
|
+
if (module.sourceMap) {
|
|
758
|
+
source.add(new webpack_sources_1.SourceMapSource(content, readableIdentifier, module.sourceMap.toString()));
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
761
|
+
source.add(new webpack_sources_1.RawSource(content));
|
|
762
|
+
}
|
|
763
|
+
source.add('\n');
|
|
764
|
+
if (needLayer) {
|
|
765
|
+
source.add('}\n');
|
|
766
|
+
}
|
|
767
|
+
if (module.media) {
|
|
768
|
+
source.add('}\n');
|
|
769
|
+
}
|
|
770
|
+
if (module.supports) {
|
|
771
|
+
source.add('}\n');
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
return new webpack_sources_1.ConcatSource(externalsSource, source);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
MiniCssExtractPlugin.pluginName = pluginName;
|
|
779
|
+
MiniCssExtractPlugin.pluginSymbol = pluginSymbol;
|
|
780
|
+
exports.default = MiniCssExtractPlugin;
|