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,904 @@
|
|
|
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 loader_runner_1 = require("loader-runner");
|
|
30
|
+
const querystring_1 = __importDefault(require("querystring"));
|
|
31
|
+
const tapable_1 = require("tapable");
|
|
32
|
+
const webpack_sources_1 = require("webpack-sources");
|
|
33
|
+
const HookBaseError_1 = require("@/base/errors/HookBaseError");
|
|
34
|
+
const ModuleBuildError_1 = __importDefault(require("@/base/errors/ModuleBuildError"));
|
|
35
|
+
const ModuleError_1 = __importDefault(require("@/base/errors/ModuleError"));
|
|
36
|
+
const ModuleParseError_1 = __importDefault(require("@/base/errors/ModuleParseError"));
|
|
37
|
+
const ModuleWarning_1 = __importDefault(require("@/base/errors/ModuleWarning"));
|
|
38
|
+
const UnhandledSchemeError_1 = __importDefault(require("@/base/errors/UnhandledSchemeError"));
|
|
39
|
+
const BaseError_1 = __importDefault(require("@/base/errors/BaseError"));
|
|
40
|
+
const formatLocation_1 = __importDefault(require("@/base/formatLocation"));
|
|
41
|
+
const LazySet_1 = __importDefault(require("@/base/LazySet"));
|
|
42
|
+
const SetHelpers_1 = require("@/base/SetHelpers");
|
|
43
|
+
const URLAbsoluteSpecifier_1 = require("@/base/URLAbsoluteSpecifier");
|
|
44
|
+
const comparators_1 = require("@/base/comparators");
|
|
45
|
+
const createHash_1 = __importDefault(require("@/base/createHash"));
|
|
46
|
+
const deprecation_1 = require("@/base/deprecation");
|
|
47
|
+
const fs_1 = require("@/base/fs");
|
|
48
|
+
const identifier_1 = require("@/base/identifier");
|
|
49
|
+
const makeSerializable_1 = __importDefault(require("@/serialization/makeSerializable"));
|
|
50
|
+
const memoize_1 = __importDefault(require("@/base/memoize"));
|
|
51
|
+
const InvalidDependenciesModuleWarning_1 = __importDefault(require("@/base/errors/InvalidDependenciesModuleWarning"));
|
|
52
|
+
const RuntimeGlobals = __importStar(require("./RuntimeGlobals"));
|
|
53
|
+
const ModuleTypeConstants_1 = require("./ModuleTypeConstants");
|
|
54
|
+
const ModuleGraphConnection_1 = require("./ModuleGraphConnection");
|
|
55
|
+
const Module_1 = __importDefault(require("./Module"));
|
|
56
|
+
const Compilation_1 = __importDefault(require("../Compilation"));
|
|
57
|
+
const parseJson = require('json-parse-even-better-errors');
|
|
58
|
+
const ABSOLUTE_PATH_REGEX = /^([a-zA-Z]:\\|\\\\|\/)/;
|
|
59
|
+
const contextifySourceUrl = (context, source, associatedObjectForCache) => {
|
|
60
|
+
if (source.startsWith('webpack://'))
|
|
61
|
+
return source;
|
|
62
|
+
return `webpack://${(0, identifier_1.makePathsRelative)(context, source, associatedObjectForCache)}`;
|
|
63
|
+
};
|
|
64
|
+
const contextifySourceMap = (context, sourceMap, associatedObjectForCache) => {
|
|
65
|
+
if (!Array.isArray(sourceMap.sources))
|
|
66
|
+
return sourceMap;
|
|
67
|
+
const { sourceRoot } = sourceMap;
|
|
68
|
+
const mapper = !sourceRoot
|
|
69
|
+
? source => source
|
|
70
|
+
: sourceRoot.endsWith('/')
|
|
71
|
+
? source => source.startsWith('/') ? `${sourceRoot.slice(0, -1)}${source}` : `${sourceRoot}${source}`
|
|
72
|
+
: source => (source.startsWith('/') ? `${sourceRoot}${source}` : `${sourceRoot}/${source}`);
|
|
73
|
+
const newSources = sourceMap.sources.map(source => contextifySourceUrl(context, mapper(source), associatedObjectForCache));
|
|
74
|
+
return Object.assign(Object.assign({}, sourceMap), { file: 'x', sourceRoot: undefined, sources: newSources });
|
|
75
|
+
};
|
|
76
|
+
const asString = (input) => {
|
|
77
|
+
if (Buffer.isBuffer(input)) {
|
|
78
|
+
return input.toString('utf-8');
|
|
79
|
+
}
|
|
80
|
+
return input;
|
|
81
|
+
};
|
|
82
|
+
const asBuffer = (input) => {
|
|
83
|
+
if (!Buffer.isBuffer(input)) {
|
|
84
|
+
return Buffer.from(input, 'utf-8');
|
|
85
|
+
}
|
|
86
|
+
return input;
|
|
87
|
+
};
|
|
88
|
+
class NonErrorEmittedError extends BaseError_1.default {
|
|
89
|
+
constructor(error) {
|
|
90
|
+
super();
|
|
91
|
+
this.name = 'NonErrorEmittedError';
|
|
92
|
+
this.message = `(Emitted value instead of an instance of Error) ${error}`;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
(0, makeSerializable_1.default)(NonErrorEmittedError, 'mp-compiler/core/module/NormalModule', 'NonErrorEmittedError');
|
|
96
|
+
const compilationHooksMap = new WeakMap();
|
|
97
|
+
class NormalModule extends Module_1.default {
|
|
98
|
+
static getCompilationHooks(compilation) {
|
|
99
|
+
if (!(compilation instanceof Compilation_1.default)) {
|
|
100
|
+
throw new TypeError("The 'compilation' argument must be an instance of Compilation");
|
|
101
|
+
}
|
|
102
|
+
let hooks = compilationHooksMap.get(compilation);
|
|
103
|
+
if (hooks === undefined) {
|
|
104
|
+
hooks = {
|
|
105
|
+
loader: new tapable_1.SyncHook(['loaderContext', 'module']),
|
|
106
|
+
beforeLoaders: new tapable_1.SyncHook(['loaders', 'module', 'loaderContext']),
|
|
107
|
+
beforeParse: new tapable_1.SyncHook(['module']),
|
|
108
|
+
beforeSnapshot: new tapable_1.SyncHook(['module']),
|
|
109
|
+
// TODO webpack 6 deprecate
|
|
110
|
+
readResourceForScheme: new tapable_1.HookMap(scheme => {
|
|
111
|
+
const hook = hooks.readResource.for(scheme);
|
|
112
|
+
return (0, deprecation_1.createFakeHook)({
|
|
113
|
+
tap: (options, fn) => hook.tap(options, loaderContext => fn(loaderContext.resource, loaderContext._module)),
|
|
114
|
+
tapAsync: (options, fn) => hook.tapAsync(options, (loaderContext, callback) => fn(loaderContext.resource, loaderContext._module, callback)),
|
|
115
|
+
tapPromise: (options, fn) => hook.tapPromise(options, loaderContext => fn(loaderContext.resource, loaderContext._module)),
|
|
116
|
+
});
|
|
117
|
+
}),
|
|
118
|
+
readResource: new tapable_1.HookMap(() => new tapable_1.AsyncSeriesBailHook(['loaderContext'])),
|
|
119
|
+
needBuild: new tapable_1.AsyncSeriesBailHook(['module', 'context']),
|
|
120
|
+
};
|
|
121
|
+
compilationHooksMap.set(compilation, hooks);
|
|
122
|
+
}
|
|
123
|
+
return hooks;
|
|
124
|
+
}
|
|
125
|
+
constructor({ layer, type, request, userRequest, rawRequest, loaders, resource, resourceResolveData, context, matchResource, parser, parserOptions, generator, generatorOptions, resolveOptions, }) {
|
|
126
|
+
super(type, context || (0, loader_runner_1.getContext)(resource), layer);
|
|
127
|
+
this.type = '';
|
|
128
|
+
// Info from Factory
|
|
129
|
+
this.request = request;
|
|
130
|
+
this.userRequest = userRequest;
|
|
131
|
+
this.rawRequest = rawRequest;
|
|
132
|
+
this.binary = /^(asset|webassembly)\b/.test(type);
|
|
133
|
+
this.parser = parser;
|
|
134
|
+
this.parserOptions = parserOptions;
|
|
135
|
+
this.generator = generator;
|
|
136
|
+
this.generatorOptions = generatorOptions;
|
|
137
|
+
this.resource = resource;
|
|
138
|
+
this.resourceResolveData = resourceResolveData;
|
|
139
|
+
this.matchResource = matchResource;
|
|
140
|
+
this.loaders = loaders;
|
|
141
|
+
if (resolveOptions !== undefined) {
|
|
142
|
+
// already declared in super class
|
|
143
|
+
this.resolveOptions = resolveOptions;
|
|
144
|
+
}
|
|
145
|
+
// Info from Build
|
|
146
|
+
this.error = null;
|
|
147
|
+
this._source = null;
|
|
148
|
+
this._sourceSizes = undefined;
|
|
149
|
+
this._sourceTypes = undefined;
|
|
150
|
+
// Cache
|
|
151
|
+
this._lastSuccessfulBuildMeta = {};
|
|
152
|
+
this._forceBuild = true;
|
|
153
|
+
this._isEvaluatingSideEffects = false;
|
|
154
|
+
this._addedSideEffectsBailout = undefined;
|
|
155
|
+
this._codeGeneratorData = new Map();
|
|
156
|
+
}
|
|
157
|
+
identifier() {
|
|
158
|
+
if (this.layer === null) {
|
|
159
|
+
if (this.type === ModuleTypeConstants_1.JAVASCRIPT_MODULE_TYPE_AUTO) {
|
|
160
|
+
return this.request;
|
|
161
|
+
}
|
|
162
|
+
return `${this.type}|${this.request}`;
|
|
163
|
+
}
|
|
164
|
+
return `${this.type}|${this.request}|${this.layer}`;
|
|
165
|
+
}
|
|
166
|
+
readableIdentifier(requestShortener) {
|
|
167
|
+
return requestShortener.shorten(this.userRequest);
|
|
168
|
+
}
|
|
169
|
+
libIdent(options) {
|
|
170
|
+
let ident = (0, identifier_1.contextify)(options.context, this.userRequest, options.associatedObjectForCache);
|
|
171
|
+
if (this.layer)
|
|
172
|
+
ident = `(${this.layer})/${ident}`;
|
|
173
|
+
return ident;
|
|
174
|
+
}
|
|
175
|
+
nameForCondition() {
|
|
176
|
+
const resource = this.matchResource || this.resource;
|
|
177
|
+
const idx = resource.indexOf('?');
|
|
178
|
+
if (idx >= 0)
|
|
179
|
+
return resource.slice(0, idx);
|
|
180
|
+
return resource;
|
|
181
|
+
}
|
|
182
|
+
updateCacheModule(module) {
|
|
183
|
+
super.updateCacheModule(module);
|
|
184
|
+
const m = module;
|
|
185
|
+
this.binary = m.binary;
|
|
186
|
+
this.request = m.request;
|
|
187
|
+
this.userRequest = m.userRequest;
|
|
188
|
+
this.rawRequest = m.rawRequest;
|
|
189
|
+
this.parser = m.parser;
|
|
190
|
+
this.parserOptions = m.parserOptions;
|
|
191
|
+
this.generator = m.generator;
|
|
192
|
+
this.generatorOptions = m.generatorOptions;
|
|
193
|
+
this.resource = m.resource;
|
|
194
|
+
this.resourceResolveData = m.resourceResolveData;
|
|
195
|
+
this.context = m.context;
|
|
196
|
+
this.matchResource = m.matchResource;
|
|
197
|
+
this.loaders = m.loaders;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Assuming this module is in the cache. Remove internal references to allow freeing some memory.
|
|
201
|
+
*/
|
|
202
|
+
cleanupForCache() {
|
|
203
|
+
// Make sure to cache types and sizes before cleanup when this module has been built
|
|
204
|
+
// They are accessed by the stats and we don't want them to crash after cleanup
|
|
205
|
+
// TODO reconsider this for webpack 6
|
|
206
|
+
if (this.buildInfo) {
|
|
207
|
+
if (this._sourceTypes === undefined)
|
|
208
|
+
this.getSourceTypes();
|
|
209
|
+
for (const type of this._sourceTypes) {
|
|
210
|
+
this.size(type);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
super.cleanupForCache();
|
|
214
|
+
this.parser = undefined;
|
|
215
|
+
this.parserOptions = undefined;
|
|
216
|
+
this.generator = undefined;
|
|
217
|
+
this.generatorOptions = undefined;
|
|
218
|
+
}
|
|
219
|
+
getUnsafeCacheData() {
|
|
220
|
+
const data = super.getUnsafeCacheData();
|
|
221
|
+
data.parserOptions = this.parserOptions;
|
|
222
|
+
data.generatorOptions = this.generatorOptions;
|
|
223
|
+
return data;
|
|
224
|
+
}
|
|
225
|
+
restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory) {
|
|
226
|
+
this._restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory);
|
|
227
|
+
}
|
|
228
|
+
_restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory) {
|
|
229
|
+
super._restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory);
|
|
230
|
+
this.parserOptions = unsafeCacheData.parserOptions;
|
|
231
|
+
this.parser = normalModuleFactory.getParser(this.type, this.parserOptions);
|
|
232
|
+
this.generatorOptions = unsafeCacheData.generatorOptions;
|
|
233
|
+
this.generator = normalModuleFactory.getGenerator(this.type, this.generatorOptions);
|
|
234
|
+
// we assume the generator behaves identically and keep cached sourceTypes/Sizes
|
|
235
|
+
}
|
|
236
|
+
createSourceForAsset(context, name, content, sourceMap, associatedObjectForCache) {
|
|
237
|
+
if (sourceMap) {
|
|
238
|
+
if (typeof sourceMap === 'string' && (this.useSourceMap || this.useSimpleSourceMap)) {
|
|
239
|
+
return new webpack_sources_1.OriginalSource(content, contextifySourceUrl(context, sourceMap, associatedObjectForCache));
|
|
240
|
+
}
|
|
241
|
+
if (this.useSourceMap) {
|
|
242
|
+
return new webpack_sources_1.SourceMapSource(content, name, contextifySourceMap(context, sourceMap, associatedObjectForCache));
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return new webpack_sources_1.RawSource(content);
|
|
246
|
+
}
|
|
247
|
+
_createLoaderContext(resolver, options, compilation, fs, hooks) {
|
|
248
|
+
const { requestShortener } = compilation.runtimeTemplate;
|
|
249
|
+
const getCurrentLoaderName = () => {
|
|
250
|
+
const currentLoader = this.getCurrentLoader(loaderContext);
|
|
251
|
+
if (!currentLoader)
|
|
252
|
+
return '(not in loader scope)';
|
|
253
|
+
return requestShortener.shorten(currentLoader.loader);
|
|
254
|
+
};
|
|
255
|
+
const getResolveContext = () => ({
|
|
256
|
+
fileDependencies: {
|
|
257
|
+
add: d => loaderContext.addDependency(d),
|
|
258
|
+
},
|
|
259
|
+
contextDependencies: {
|
|
260
|
+
add: d => loaderContext.addContextDependency(d),
|
|
261
|
+
},
|
|
262
|
+
missingDependencies: {
|
|
263
|
+
add: d => loaderContext.addMissingDependency(d),
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
const getAbsolutify = (0, memoize_1.default)(() => identifier_1.absolutify.bindCache(compilation.compiler.root));
|
|
267
|
+
const getAbsolutifyInContext = (0, memoize_1.default)(() => identifier_1.absolutify.bindContextCache(this.context, compilation.compiler.root));
|
|
268
|
+
const getContextify = (0, memoize_1.default)(() => identifier_1.contextify.bindCache(compilation.compiler.root));
|
|
269
|
+
const getContextifyInContext = (0, memoize_1.default)(() => identifier_1.contextify.bindContextCache(this.context, compilation.compiler.root));
|
|
270
|
+
const utils = {
|
|
271
|
+
absolutify: (context, request) => context === this.context
|
|
272
|
+
? getAbsolutifyInContext()(request)
|
|
273
|
+
: getAbsolutify()(context, request),
|
|
274
|
+
contextify: (context, request) => context === this.context
|
|
275
|
+
? getContextifyInContext()(request)
|
|
276
|
+
: getContextify()(context, request),
|
|
277
|
+
createHash: type => (0, createHash_1.default)(type || compilation.outputOptions.hashFunction),
|
|
278
|
+
};
|
|
279
|
+
const loaderContext = {
|
|
280
|
+
version: 2,
|
|
281
|
+
getOptions: schema => {
|
|
282
|
+
const loader = this.getCurrentLoader(loaderContext);
|
|
283
|
+
let { options } = loader;
|
|
284
|
+
if (typeof options === 'string') {
|
|
285
|
+
if (options.startsWith('{') && options.endsWith('}')) {
|
|
286
|
+
try {
|
|
287
|
+
options = parseJson(options);
|
|
288
|
+
}
|
|
289
|
+
catch (e) {
|
|
290
|
+
throw new Error(`Cannot parse string options: ${e.message}`);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
options = querystring_1.default.parse(options, '&', '=', {
|
|
295
|
+
maxKeys: 0,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
if (options === null || options === undefined) {
|
|
300
|
+
options = {};
|
|
301
|
+
}
|
|
302
|
+
// if (schema) {
|
|
303
|
+
// let name = 'Loader'
|
|
304
|
+
// let baseDataPath = 'options'
|
|
305
|
+
// let match
|
|
306
|
+
// if (schema.title && (match = /^(.+) (.+)$/.exec(schema.title))) {
|
|
307
|
+
// ;[, name, baseDataPath] = match
|
|
308
|
+
// }
|
|
309
|
+
// getValidate()(schema, options, {
|
|
310
|
+
// name,
|
|
311
|
+
// baseDataPath,
|
|
312
|
+
// })
|
|
313
|
+
// }
|
|
314
|
+
return options;
|
|
315
|
+
},
|
|
316
|
+
emitWarning: warning => {
|
|
317
|
+
if (!(warning instanceof Error)) {
|
|
318
|
+
warning = new NonErrorEmittedError(warning);
|
|
319
|
+
}
|
|
320
|
+
this.addWarning(new ModuleWarning_1.default(warning, {
|
|
321
|
+
from: getCurrentLoaderName(),
|
|
322
|
+
}));
|
|
323
|
+
},
|
|
324
|
+
emitError: error => {
|
|
325
|
+
if (!(error instanceof Error)) {
|
|
326
|
+
error = new NonErrorEmittedError(error);
|
|
327
|
+
}
|
|
328
|
+
this.addError(new ModuleError_1.default(error, {
|
|
329
|
+
from: getCurrentLoaderName(),
|
|
330
|
+
}));
|
|
331
|
+
},
|
|
332
|
+
getLogger: name => {
|
|
333
|
+
const currentLoader = this.getCurrentLoader(loaderContext);
|
|
334
|
+
return compilation.getLogger(() => [currentLoader === null || currentLoader === void 0 ? void 0 : currentLoader.loader, name, this.identifier()].filter(Boolean).join('|'));
|
|
335
|
+
},
|
|
336
|
+
resolve(context, request, callback) {
|
|
337
|
+
resolver.resolve({}, context, request, getResolveContext(), callback);
|
|
338
|
+
},
|
|
339
|
+
getResolve(options) {
|
|
340
|
+
const child = options ? resolver.withOptions(options) : resolver;
|
|
341
|
+
return (context, request, callback) => {
|
|
342
|
+
if (callback) {
|
|
343
|
+
child.resolve({}, context, request, getResolveContext(), callback);
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
return new Promise((resolve, reject) => {
|
|
347
|
+
child.resolve({}, context, request, getResolveContext(), (err, result) => {
|
|
348
|
+
if (err)
|
|
349
|
+
reject(err);
|
|
350
|
+
else
|
|
351
|
+
resolve(result);
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
},
|
|
357
|
+
emitFile: (name, content, sourceMap, assetInfo) => {
|
|
358
|
+
if (!this.buildInfo.assets) {
|
|
359
|
+
this.buildInfo.assets = Object.create(null);
|
|
360
|
+
this.buildInfo.assetsInfo = new Map();
|
|
361
|
+
}
|
|
362
|
+
this.buildInfo.assets[name] = this.createSourceForAsset(options.context, name, content, sourceMap, compilation.compiler.root);
|
|
363
|
+
this.buildInfo.assetsInfo.set(name, assetInfo);
|
|
364
|
+
},
|
|
365
|
+
addBuildDependency: dep => {
|
|
366
|
+
if (this.buildInfo.buildDependencies === undefined) {
|
|
367
|
+
this.buildInfo.buildDependencies = new LazySet_1.default();
|
|
368
|
+
}
|
|
369
|
+
this.buildInfo.buildDependencies.add(dep);
|
|
370
|
+
},
|
|
371
|
+
utils,
|
|
372
|
+
rootContext: options.context,
|
|
373
|
+
webpack: true,
|
|
374
|
+
sourceMap: !!this.useSourceMap,
|
|
375
|
+
mode: options.mode || 'production',
|
|
376
|
+
_module: this,
|
|
377
|
+
_compilation: compilation,
|
|
378
|
+
_compiler: compilation.compiler,
|
|
379
|
+
fs,
|
|
380
|
+
};
|
|
381
|
+
Object.assign(loaderContext, options.loader);
|
|
382
|
+
hooks.loader.call(loaderContext, this);
|
|
383
|
+
return loaderContext;
|
|
384
|
+
}
|
|
385
|
+
getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) {
|
|
386
|
+
var _a;
|
|
387
|
+
if (((_a = this.loaders) === null || _a === void 0 ? void 0 : _a.length) && index < this.loaders.length && index >= 0 && this.loaders[index]) {
|
|
388
|
+
return this.loaders[index];
|
|
389
|
+
}
|
|
390
|
+
return null;
|
|
391
|
+
}
|
|
392
|
+
createSource(context, content, sourceMap, associatedObjectForCache) {
|
|
393
|
+
if (Buffer.isBuffer(content)) {
|
|
394
|
+
// @ts-ignore
|
|
395
|
+
return new webpack_sources_1.RawSource(content);
|
|
396
|
+
}
|
|
397
|
+
// if there is no identifier return raw source
|
|
398
|
+
if (!this.identifier) {
|
|
399
|
+
return new webpack_sources_1.RawSource(content);
|
|
400
|
+
}
|
|
401
|
+
// from here on we assume we have an identifier
|
|
402
|
+
const identifier = this.identifier();
|
|
403
|
+
if (this.useSourceMap && sourceMap) {
|
|
404
|
+
return new webpack_sources_1.SourceMapSource(content, contextifySourceUrl(context, identifier, associatedObjectForCache), contextifySourceMap(context, sourceMap, associatedObjectForCache));
|
|
405
|
+
}
|
|
406
|
+
if (this.useSourceMap || this.useSimpleSourceMap) {
|
|
407
|
+
return new webpack_sources_1.OriginalSource(content, contextifySourceUrl(context, identifier, associatedObjectForCache));
|
|
408
|
+
}
|
|
409
|
+
return new webpack_sources_1.RawSource(content);
|
|
410
|
+
}
|
|
411
|
+
_doBuild(options, compilation, resolver, fs, hooks, callback) {
|
|
412
|
+
const loaderContext = this._createLoaderContext(resolver, options, compilation, fs, hooks);
|
|
413
|
+
const processResult = (err, result) => {
|
|
414
|
+
if (err) {
|
|
415
|
+
if (!(err instanceof Error)) {
|
|
416
|
+
err = new NonErrorEmittedError(err);
|
|
417
|
+
}
|
|
418
|
+
const currentLoader = this.getCurrentLoader(loaderContext);
|
|
419
|
+
const error = new ModuleBuildError_1.default(err, {
|
|
420
|
+
from: currentLoader &&
|
|
421
|
+
compilation.runtimeTemplate.requestShortener.shorten(currentLoader.loader),
|
|
422
|
+
});
|
|
423
|
+
return callback(error);
|
|
424
|
+
}
|
|
425
|
+
const source = result[0];
|
|
426
|
+
const sourceMap = result.length >= 1 ? result[1] : null;
|
|
427
|
+
const extraInfo = result.length >= 2 ? result[2] : null;
|
|
428
|
+
if (!Buffer.isBuffer(source) && typeof source !== 'string') {
|
|
429
|
+
const currentLoader = this.getCurrentLoader(loaderContext, 0);
|
|
430
|
+
const err = new Error(`Final loader (${currentLoader
|
|
431
|
+
? compilation.runtimeTemplate.requestShortener.shorten(currentLoader.loader)
|
|
432
|
+
: 'unknown'}) didn't return a Buffer or String`);
|
|
433
|
+
const error = new ModuleBuildError_1.default(err);
|
|
434
|
+
return callback(error);
|
|
435
|
+
}
|
|
436
|
+
this._source = this.createSource(options.context, this.binary ? asBuffer(source) : asString(source), sourceMap, compilation.compiler.root);
|
|
437
|
+
if (this._sourceSizes !== undefined)
|
|
438
|
+
this._sourceSizes.clear();
|
|
439
|
+
this._ast =
|
|
440
|
+
typeof extraInfo === 'object' && extraInfo !== null && extraInfo.webpackAST !== undefined
|
|
441
|
+
? extraInfo.webpackAST
|
|
442
|
+
: null;
|
|
443
|
+
return callback();
|
|
444
|
+
};
|
|
445
|
+
this.buildInfo.fileDependencies = new LazySet_1.default();
|
|
446
|
+
this.buildInfo.contextDependencies = new LazySet_1.default();
|
|
447
|
+
this.buildInfo.missingDependencies = new LazySet_1.default();
|
|
448
|
+
this.buildInfo.cacheable = true;
|
|
449
|
+
try {
|
|
450
|
+
hooks.beforeLoaders.call(this.loaders, this, loaderContext);
|
|
451
|
+
}
|
|
452
|
+
catch (err) {
|
|
453
|
+
processResult(err);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
if (this.loaders.length > 0) {
|
|
457
|
+
this.buildInfo.buildDependencies = new LazySet_1.default();
|
|
458
|
+
}
|
|
459
|
+
(0, loader_runner_1.runLoaders)({
|
|
460
|
+
resource: this.resource,
|
|
461
|
+
loaders: this.loaders,
|
|
462
|
+
context: loaderContext,
|
|
463
|
+
processResource: (loaderContext, resourcePath, callback) => {
|
|
464
|
+
const resource = loaderContext.resource;
|
|
465
|
+
const scheme = (0, URLAbsoluteSpecifier_1.getScheme)(resource);
|
|
466
|
+
hooks.readResource.for(scheme).callAsync(loaderContext, (err, result) => {
|
|
467
|
+
if (err)
|
|
468
|
+
return callback(err);
|
|
469
|
+
if (typeof result !== 'string' && !result) {
|
|
470
|
+
return callback(new UnhandledSchemeError_1.default(scheme, resource));
|
|
471
|
+
}
|
|
472
|
+
return callback(null, result);
|
|
473
|
+
});
|
|
474
|
+
},
|
|
475
|
+
}, (err, result) => {
|
|
476
|
+
// Cleanup loaderContext to avoid leaking memory in ICs
|
|
477
|
+
loaderContext._compilation =
|
|
478
|
+
loaderContext._compiler =
|
|
479
|
+
loaderContext._module =
|
|
480
|
+
loaderContext.fs =
|
|
481
|
+
undefined;
|
|
482
|
+
if (!result) {
|
|
483
|
+
this.buildInfo.cacheable = false;
|
|
484
|
+
return processResult(err || new Error('No result from loader-runner processing'), null);
|
|
485
|
+
}
|
|
486
|
+
this.buildInfo.fileDependencies.addAll(result.fileDependencies);
|
|
487
|
+
this.buildInfo.contextDependencies.addAll(result.contextDependencies);
|
|
488
|
+
this.buildInfo.missingDependencies.addAll(result.missingDependencies);
|
|
489
|
+
for (const loader of this.loaders) {
|
|
490
|
+
this.buildInfo.buildDependencies.add(loader.loader);
|
|
491
|
+
}
|
|
492
|
+
this.buildInfo.cacheable = this.buildInfo.cacheable && result.cacheable;
|
|
493
|
+
processResult(err, result.result);
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
markModuleAsErrored(error) {
|
|
497
|
+
// Restore build meta from successful build to keep importing state
|
|
498
|
+
this.buildMeta = Object.assign({}, this._lastSuccessfulBuildMeta);
|
|
499
|
+
this.error = error;
|
|
500
|
+
this.addError(error);
|
|
501
|
+
}
|
|
502
|
+
applyNoParseRule(rule, content) {
|
|
503
|
+
// must start with "rule" if rule is a string
|
|
504
|
+
if (typeof rule === 'string') {
|
|
505
|
+
return content.startsWith(rule);
|
|
506
|
+
}
|
|
507
|
+
if (typeof rule === 'function') {
|
|
508
|
+
return rule(content);
|
|
509
|
+
}
|
|
510
|
+
// we assume rule is a regexp
|
|
511
|
+
return rule.test(content);
|
|
512
|
+
}
|
|
513
|
+
// check if module should not be parsed
|
|
514
|
+
// returns "true" if the module should !not! be parsed
|
|
515
|
+
// returns "false" if the module !must! be parsed
|
|
516
|
+
shouldPreventParsing(noParseRule, request) {
|
|
517
|
+
// if no noParseRule exists, return false
|
|
518
|
+
// the module !must! be parsed.
|
|
519
|
+
if (!noParseRule) {
|
|
520
|
+
return false;
|
|
521
|
+
}
|
|
522
|
+
// we only have one rule to check
|
|
523
|
+
if (!Array.isArray(noParseRule)) {
|
|
524
|
+
// returns "true" if the module is !not! to be parsed
|
|
525
|
+
return this.applyNoParseRule(noParseRule, request);
|
|
526
|
+
}
|
|
527
|
+
for (let i = 0; i < noParseRule.length; i++) {
|
|
528
|
+
const rule = noParseRule[i];
|
|
529
|
+
// early exit on first truthy match
|
|
530
|
+
// this module is !not! to be parsed
|
|
531
|
+
if (this.applyNoParseRule(rule, request)) {
|
|
532
|
+
return true;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
// no match found, so this module !should! be parsed
|
|
536
|
+
return false;
|
|
537
|
+
}
|
|
538
|
+
_initBuildHash(compilation) {
|
|
539
|
+
const hash = (0, createHash_1.default)(compilation.outputOptions.hashFunction);
|
|
540
|
+
if (this._source) {
|
|
541
|
+
hash.update('source');
|
|
542
|
+
this._source.updateHash(hash);
|
|
543
|
+
}
|
|
544
|
+
hash.update('meta');
|
|
545
|
+
hash.update(JSON.stringify(this.buildMeta));
|
|
546
|
+
this.buildInfo.hash = hash.digest('hex');
|
|
547
|
+
}
|
|
548
|
+
build(options, compilation, resolver, fs, callback) {
|
|
549
|
+
this._forceBuild = false;
|
|
550
|
+
this._source = null;
|
|
551
|
+
if (this._sourceSizes !== undefined)
|
|
552
|
+
this._sourceSizes.clear();
|
|
553
|
+
this._sourceTypes = undefined;
|
|
554
|
+
this._ast = null;
|
|
555
|
+
this.error = null;
|
|
556
|
+
this.clearWarningsAndErrors();
|
|
557
|
+
this.clearDependenciesAndBlocks();
|
|
558
|
+
this.buildMeta = {};
|
|
559
|
+
this.buildInfo = {
|
|
560
|
+
cacheable: false,
|
|
561
|
+
parsed: true,
|
|
562
|
+
fileDependencies: undefined,
|
|
563
|
+
contextDependencies: undefined,
|
|
564
|
+
missingDependencies: undefined,
|
|
565
|
+
buildDependencies: undefined,
|
|
566
|
+
valueDependencies: undefined,
|
|
567
|
+
hash: undefined,
|
|
568
|
+
assets: undefined,
|
|
569
|
+
assetsInfo: undefined,
|
|
570
|
+
};
|
|
571
|
+
const startTime = compilation.compiler.fsStartTime || Date.now();
|
|
572
|
+
const hooks = NormalModule.getCompilationHooks(compilation);
|
|
573
|
+
return this._doBuild(options, compilation, resolver, fs, hooks, err => {
|
|
574
|
+
var _a;
|
|
575
|
+
// if we have an error mark module as failed and exit
|
|
576
|
+
if (err) {
|
|
577
|
+
this.markModuleAsErrored(err);
|
|
578
|
+
this._initBuildHash(compilation);
|
|
579
|
+
return callback();
|
|
580
|
+
}
|
|
581
|
+
const handleParseError = e => {
|
|
582
|
+
const source = this._source.source();
|
|
583
|
+
const loaders = this.loaders.map(item => (0, identifier_1.contextify)(options.context, item.loader, compilation.compiler.root));
|
|
584
|
+
const error = new ModuleParseError_1.default(source, e, loaders, this.type);
|
|
585
|
+
this.markModuleAsErrored(error);
|
|
586
|
+
this._initBuildHash(compilation);
|
|
587
|
+
return callback();
|
|
588
|
+
};
|
|
589
|
+
const handleParseResult = result => {
|
|
590
|
+
this.dependencies.sort((0, comparators_1.concatComparators)((0, comparators_1.compareSelect)(a => a.loc, comparators_1.compareLocations), (0, comparators_1.keepOriginalOrder)(this.dependencies)));
|
|
591
|
+
this._initBuildHash(compilation);
|
|
592
|
+
this._lastSuccessfulBuildMeta = this.buildMeta;
|
|
593
|
+
return handleBuildDone();
|
|
594
|
+
};
|
|
595
|
+
const handleBuildDone = () => {
|
|
596
|
+
try {
|
|
597
|
+
hooks.beforeSnapshot.call(this);
|
|
598
|
+
}
|
|
599
|
+
catch (err) {
|
|
600
|
+
this.markModuleAsErrored(err);
|
|
601
|
+
return callback();
|
|
602
|
+
}
|
|
603
|
+
const snapshotOptions = compilation.options.snapshot.module;
|
|
604
|
+
if (!this.buildInfo.cacheable || !snapshotOptions) {
|
|
605
|
+
return callback();
|
|
606
|
+
}
|
|
607
|
+
// add warning for all non-absolute paths in fileDependencies, etc
|
|
608
|
+
// This makes it easier to find problems with watching and/or caching
|
|
609
|
+
let nonAbsoluteDependencies;
|
|
610
|
+
const checkDependencies = deps => {
|
|
611
|
+
for (const dep of deps) {
|
|
612
|
+
if (!ABSOLUTE_PATH_REGEX.test(dep)) {
|
|
613
|
+
if (nonAbsoluteDependencies === undefined)
|
|
614
|
+
nonAbsoluteDependencies = new Set();
|
|
615
|
+
nonAbsoluteDependencies.add(dep);
|
|
616
|
+
deps.delete(dep);
|
|
617
|
+
try {
|
|
618
|
+
const depWithoutGlob = dep.replace(/[\\/]?\*.*$/, '');
|
|
619
|
+
const absolute = (0, fs_1.join)(compilation.fileSystemInfo.fs, this.context, depWithoutGlob);
|
|
620
|
+
if (absolute !== dep && ABSOLUTE_PATH_REGEX.test(absolute)) {
|
|
621
|
+
;
|
|
622
|
+
(depWithoutGlob !== dep ? this.buildInfo.contextDependencies : deps).add(absolute);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
catch (e) {
|
|
626
|
+
// ignore
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
checkDependencies(this.buildInfo.fileDependencies);
|
|
632
|
+
checkDependencies(this.buildInfo.missingDependencies);
|
|
633
|
+
checkDependencies(this.buildInfo.contextDependencies);
|
|
634
|
+
if (nonAbsoluteDependencies !== undefined) {
|
|
635
|
+
this.addWarning(new InvalidDependenciesModuleWarning_1.default(this, nonAbsoluteDependencies));
|
|
636
|
+
}
|
|
637
|
+
// convert file/context/missingDependencies into filesystem snapshot
|
|
638
|
+
compilation.fileSystemInfo.createSnapshot(startTime, this.buildInfo.fileDependencies, this.buildInfo.contextDependencies, this.buildInfo.missingDependencies, snapshotOptions, (err, snapshot) => {
|
|
639
|
+
if (err) {
|
|
640
|
+
this.markModuleAsErrored(err);
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
this.buildInfo.fileDependencies = undefined;
|
|
644
|
+
this.buildInfo.contextDependencies = undefined;
|
|
645
|
+
this.buildInfo.missingDependencies = undefined;
|
|
646
|
+
this.buildInfo.snapshot = snapshot;
|
|
647
|
+
return callback();
|
|
648
|
+
});
|
|
649
|
+
};
|
|
650
|
+
try {
|
|
651
|
+
hooks.beforeParse.call(this);
|
|
652
|
+
}
|
|
653
|
+
catch (err) {
|
|
654
|
+
this.markModuleAsErrored(err);
|
|
655
|
+
this._initBuildHash(compilation);
|
|
656
|
+
return callback();
|
|
657
|
+
}
|
|
658
|
+
// check if this module should !not! be parsed.
|
|
659
|
+
// if so, exit here;
|
|
660
|
+
const noParseRule = (_a = options.module) === null || _a === void 0 ? void 0 : _a.noParse;
|
|
661
|
+
if (this.shouldPreventParsing(noParseRule, this.request)) {
|
|
662
|
+
// We assume that we need module and exports
|
|
663
|
+
this.buildInfo.parsed = false;
|
|
664
|
+
this._initBuildHash(compilation);
|
|
665
|
+
return handleBuildDone();
|
|
666
|
+
}
|
|
667
|
+
let result;
|
|
668
|
+
try {
|
|
669
|
+
const source = this._source.source();
|
|
670
|
+
result = this.parser.parse(this._ast || source, {
|
|
671
|
+
source,
|
|
672
|
+
current: this,
|
|
673
|
+
module: this,
|
|
674
|
+
compilation,
|
|
675
|
+
options,
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
catch (e) {
|
|
679
|
+
handleParseError(e);
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
handleParseResult(result);
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
getConcatenationBailoutReason(context) {
|
|
686
|
+
return this.generator.getConcatenationBailoutReason(this, context);
|
|
687
|
+
}
|
|
688
|
+
getSideEffectsConnectionState(moduleGraph) {
|
|
689
|
+
var _a;
|
|
690
|
+
if (this.factoryMeta !== undefined) {
|
|
691
|
+
if (this.factoryMeta.sideEffectFree)
|
|
692
|
+
return false;
|
|
693
|
+
if (this.factoryMeta.sideEffectFree === false)
|
|
694
|
+
return true;
|
|
695
|
+
}
|
|
696
|
+
if ((_a = this.buildMeta) === null || _a === void 0 ? void 0 : _a.sideEffectFree) {
|
|
697
|
+
if (this._isEvaluatingSideEffects)
|
|
698
|
+
return ModuleGraphConnection_1.CIRCULAR_CONNECTION;
|
|
699
|
+
this._isEvaluatingSideEffects = true;
|
|
700
|
+
let current = false;
|
|
701
|
+
for (const dep of this.dependencies) {
|
|
702
|
+
const state = dep.getModuleEvaluationSideEffectsState(moduleGraph);
|
|
703
|
+
if (state === true) {
|
|
704
|
+
if (this._addedSideEffectsBailout === undefined
|
|
705
|
+
? ((this._addedSideEffectsBailout = new WeakSet()), true)
|
|
706
|
+
: !this._addedSideEffectsBailout.has(moduleGraph)) {
|
|
707
|
+
this._addedSideEffectsBailout.add(moduleGraph);
|
|
708
|
+
moduleGraph
|
|
709
|
+
.getOptimizationBailout(this)
|
|
710
|
+
.push(() => `Dependency (${dep.type}) with side effects at ${(0, formatLocation_1.default)(dep.loc)}`);
|
|
711
|
+
}
|
|
712
|
+
this._isEvaluatingSideEffects = false;
|
|
713
|
+
return true;
|
|
714
|
+
}
|
|
715
|
+
if (state !== ModuleGraphConnection_1.CIRCULAR_CONNECTION) {
|
|
716
|
+
current = (0, ModuleGraphConnection_1.addConnectionStates)(current, state);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
this._isEvaluatingSideEffects = false;
|
|
720
|
+
// When caching is implemented here, make sure to not cache when
|
|
721
|
+
// at least one circular connection was in the loop above
|
|
722
|
+
return current;
|
|
723
|
+
}
|
|
724
|
+
return true;
|
|
725
|
+
}
|
|
726
|
+
getSourceTypes() {
|
|
727
|
+
if (this._sourceTypes === undefined) {
|
|
728
|
+
this._sourceTypes = this.generator.getTypes(this);
|
|
729
|
+
}
|
|
730
|
+
return this._sourceTypes;
|
|
731
|
+
}
|
|
732
|
+
codeGeneration({ dependencyTemplates, runtimeTemplate, moduleGraph, chunkGraph, runtime, concatenationScope, codeGenerationResults, sourceTypes, }) {
|
|
733
|
+
const runtimeRequirements = new Set();
|
|
734
|
+
if (!this.buildInfo.parsed) {
|
|
735
|
+
runtimeRequirements.add(RuntimeGlobals.module);
|
|
736
|
+
runtimeRequirements.add(RuntimeGlobals.exports);
|
|
737
|
+
runtimeRequirements.add(RuntimeGlobals.thisAsExports);
|
|
738
|
+
}
|
|
739
|
+
const getData = () => this._codeGeneratorData;
|
|
740
|
+
const sources = new Map();
|
|
741
|
+
for (const type of sourceTypes || chunkGraph.getModuleSourceTypes(this)) {
|
|
742
|
+
const source = this.error
|
|
743
|
+
? new webpack_sources_1.RawSource(`throw new Error(${JSON.stringify(this.error.message)});`)
|
|
744
|
+
: this.generator.generate(this, {
|
|
745
|
+
dependencyTemplates,
|
|
746
|
+
runtimeTemplate,
|
|
747
|
+
moduleGraph,
|
|
748
|
+
chunkGraph,
|
|
749
|
+
runtimeRequirements,
|
|
750
|
+
runtime,
|
|
751
|
+
concatenationScope,
|
|
752
|
+
codeGenerationResults,
|
|
753
|
+
getData,
|
|
754
|
+
type,
|
|
755
|
+
});
|
|
756
|
+
if (source) {
|
|
757
|
+
sources.set(type, new webpack_sources_1.CachedSource(source));
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
const resultEntry = {
|
|
761
|
+
sources,
|
|
762
|
+
runtimeRequirements,
|
|
763
|
+
data: this._codeGeneratorData,
|
|
764
|
+
};
|
|
765
|
+
return resultEntry;
|
|
766
|
+
}
|
|
767
|
+
originalSource() {
|
|
768
|
+
return this._source;
|
|
769
|
+
}
|
|
770
|
+
invalidateBuild() {
|
|
771
|
+
this._forceBuild = true;
|
|
772
|
+
}
|
|
773
|
+
needBuild(context, callback) {
|
|
774
|
+
const { fileSystemInfo, compilation, valueCacheVersions } = context;
|
|
775
|
+
// build if enforced
|
|
776
|
+
if (this._forceBuild)
|
|
777
|
+
return callback(null, true);
|
|
778
|
+
// always try to build in case of an error
|
|
779
|
+
if (this.error)
|
|
780
|
+
return callback(null, true);
|
|
781
|
+
// always build when module is not cacheable
|
|
782
|
+
if (!this.buildInfo.cacheable)
|
|
783
|
+
return callback(null, true);
|
|
784
|
+
// build when there is no snapshot to check
|
|
785
|
+
if (!this.buildInfo.snapshot)
|
|
786
|
+
return callback(null, true);
|
|
787
|
+
// build when valueDependencies have changed
|
|
788
|
+
const valueDependencies = this.buildInfo.valueDependencies;
|
|
789
|
+
if (valueDependencies) {
|
|
790
|
+
if (!valueCacheVersions)
|
|
791
|
+
return callback(null, true);
|
|
792
|
+
for (const [key, value] of valueDependencies) {
|
|
793
|
+
if (value === undefined)
|
|
794
|
+
return callback(null, true);
|
|
795
|
+
const current = valueCacheVersions.get(key);
|
|
796
|
+
if (value !== current &&
|
|
797
|
+
(typeof value === 'string' ||
|
|
798
|
+
typeof current === 'string' ||
|
|
799
|
+
current === undefined ||
|
|
800
|
+
!(0, SetHelpers_1.isSubset)(value, current))) {
|
|
801
|
+
return callback(null, true);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
// check snapshot for validity
|
|
806
|
+
fileSystemInfo.checkSnapshotValid(this.buildInfo.snapshot, (err, valid) => {
|
|
807
|
+
if (err)
|
|
808
|
+
return callback(err);
|
|
809
|
+
if (!valid) {
|
|
810
|
+
console.log('没命中缓存', this.identifier());
|
|
811
|
+
return callback(null, true);
|
|
812
|
+
}
|
|
813
|
+
console.log('命中缓存', this.identifier());
|
|
814
|
+
const hooks = NormalModule.getCompilationHooks(compilation);
|
|
815
|
+
hooks.needBuild.callAsync(this, context, (err, needBuild) => {
|
|
816
|
+
if (err) {
|
|
817
|
+
return callback((0, HookBaseError_1.makeBaseError)(err, 'NormalModule.getCompilationHooks().needBuild'));
|
|
818
|
+
}
|
|
819
|
+
callback(null, !!needBuild);
|
|
820
|
+
});
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
size(type) {
|
|
824
|
+
const cachedSize = this._sourceSizes === undefined ? undefined : this._sourceSizes.get(type);
|
|
825
|
+
if (cachedSize !== undefined) {
|
|
826
|
+
return cachedSize;
|
|
827
|
+
}
|
|
828
|
+
const size = Math.max(1, this.generator.getSize(this, type));
|
|
829
|
+
if (this._sourceSizes === undefined) {
|
|
830
|
+
this._sourceSizes = new Map();
|
|
831
|
+
}
|
|
832
|
+
this._sourceSizes.set(type, size);
|
|
833
|
+
return size;
|
|
834
|
+
}
|
|
835
|
+
addCacheDependencies(fileDependencies, contextDependencies, missingDependencies, buildDependencies) {
|
|
836
|
+
const { snapshot, buildDependencies: buildDeps } = this.buildInfo;
|
|
837
|
+
if (snapshot) {
|
|
838
|
+
fileDependencies.addAll(snapshot.getFileIterable());
|
|
839
|
+
contextDependencies.addAll(snapshot.getContextIterable());
|
|
840
|
+
missingDependencies.addAll(snapshot.getMissingIterable());
|
|
841
|
+
}
|
|
842
|
+
else {
|
|
843
|
+
const { fileDependencies: fileDeps, contextDependencies: contextDeps, missingDependencies: missingDeps, } = this.buildInfo;
|
|
844
|
+
if (fileDeps !== undefined)
|
|
845
|
+
fileDependencies.addAll(fileDeps);
|
|
846
|
+
if (contextDeps !== undefined)
|
|
847
|
+
contextDependencies.addAll(contextDeps);
|
|
848
|
+
if (missingDeps !== undefined)
|
|
849
|
+
missingDependencies.addAll(missingDeps);
|
|
850
|
+
}
|
|
851
|
+
if (buildDeps !== undefined) {
|
|
852
|
+
buildDependencies.addAll(buildDeps);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
updateHash(hash, context) {
|
|
856
|
+
hash.update(this.buildInfo.hash);
|
|
857
|
+
this.generator.updateHash(hash, Object.assign({ module: this }, context));
|
|
858
|
+
super.updateHash(hash, context);
|
|
859
|
+
}
|
|
860
|
+
serialize(context) {
|
|
861
|
+
const { write } = context;
|
|
862
|
+
// deserialize
|
|
863
|
+
write(this._source);
|
|
864
|
+
write(this.error);
|
|
865
|
+
write(this._lastSuccessfulBuildMeta);
|
|
866
|
+
write(this._forceBuild);
|
|
867
|
+
write(this._codeGeneratorData);
|
|
868
|
+
super.serialize(context);
|
|
869
|
+
}
|
|
870
|
+
static deserialize(context) {
|
|
871
|
+
const obj = new NormalModule({
|
|
872
|
+
// will be deserialized by Module
|
|
873
|
+
layer: null,
|
|
874
|
+
type: '',
|
|
875
|
+
// will be filled by updateCacheModule
|
|
876
|
+
resource: '',
|
|
877
|
+
context: '',
|
|
878
|
+
request: null,
|
|
879
|
+
userRequest: null,
|
|
880
|
+
rawRequest: null,
|
|
881
|
+
loaders: null,
|
|
882
|
+
matchResource: null,
|
|
883
|
+
parser: null,
|
|
884
|
+
parserOptions: null,
|
|
885
|
+
generator: null,
|
|
886
|
+
generatorOptions: null,
|
|
887
|
+
resolveOptions: null,
|
|
888
|
+
resourceResolveData: null,
|
|
889
|
+
});
|
|
890
|
+
obj.deserialize(context);
|
|
891
|
+
return obj;
|
|
892
|
+
}
|
|
893
|
+
deserialize(context) {
|
|
894
|
+
const { read } = context;
|
|
895
|
+
this._source = read();
|
|
896
|
+
this.error = read();
|
|
897
|
+
this._lastSuccessfulBuildMeta = read();
|
|
898
|
+
this._forceBuild = read();
|
|
899
|
+
this._codeGeneratorData = read();
|
|
900
|
+
super.deserialize(context);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
(0, makeSerializable_1.default)(NormalModule, 'mp-compiler/core/module/NormalModule');
|
|
904
|
+
exports.default = NormalModule;
|