@depup/webpack 5.106.1-depup.0 → 5.109.2-depup.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 +9 -11
- package/bin/webpack.js +12 -0
- package/changes.json +16 -24
- package/hot/dev-server.js +2 -0
- package/lib/APIPlugin.js +60 -35
- package/lib/AsyncDependenciesBlock.js +3 -0
- package/lib/AutomaticPrefetchPlugin.js +6 -1
- package/lib/BannerPlugin.js +13 -5
- package/lib/Cache.js +27 -5
- package/lib/CacheFacade.js +41 -0
- package/lib/Chunk.js +71 -25
- package/lib/ChunkGraph.js +153 -19
- package/lib/ChunkGroup.js +115 -28
- package/lib/ChunkTemplate.js +9 -0
- package/lib/CircularModulesPlugin.js +190 -0
- package/lib/CleanPlugin.js +27 -28
- package/lib/CodeGenerationResults.js +19 -0
- package/lib/CompatibilityPlugin.js +85 -37
- package/lib/Compilation.js +656 -112
- package/lib/Compiler.js +109 -35
- package/lib/ConcatenationScope.js +34 -4
- package/lib/ConditionalInitFragment.js +6 -0
- package/lib/ConstPlugin.js +15 -12
- package/lib/ContextExclusionPlugin.js +3 -1
- package/lib/ContextModule.js +345 -55
- package/lib/ContextModuleFactory.js +193 -51
- package/lib/ContextReplacementPlugin.js +8 -1
- package/lib/DefinePlugin.js +537 -139
- package/lib/DependenciesBlock.js +6 -1
- package/lib/Dependency.js +159 -11
- package/lib/DependencyTemplate.js +7 -1
- package/lib/DependencyTemplates.js +4 -0
- package/lib/DotenvPlugin.js +3 -0
- package/lib/DynamicEntryPlugin.js +3 -1
- package/lib/EntryOptionPlugin.js +42 -2
- package/lib/EntryPlugin.js +4 -1
- package/lib/Entrypoint.js +5 -1
- package/lib/EnvironmentPlugin.js +3 -2
- package/lib/ErrorHelpers.js +7 -0
- package/lib/EvalDevToolModulePlugin.js +3 -1
- package/lib/EvalSourceMapDevToolPlugin.js +11 -11
- package/lib/ExportsInfo.js +421 -113
- package/lib/ExportsInfoApiPlugin.js +4 -3
- package/lib/ExternalModule.js +381 -80
- package/lib/ExternalModuleFactoryPlugin.js +75 -3
- package/lib/ExternalsPlugin.js +3 -1
- package/lib/FileSystemInfo.js +701 -175
- package/lib/FlagAllModulesAsUsedPlugin.js +3 -6
- package/lib/FlagDependencyExportsPlugin.js +82 -9
- package/lib/FlagDependencyUsagePlugin.js +115 -8
- package/lib/FlagEntryExportAsUsedPlugin.js +4 -1
- package/lib/Generator.js +24 -3
- package/lib/HotModuleReplacementPlugin.js +110 -44
- package/lib/IgnorePlugin.js +5 -2
- package/lib/IgnoreWarningsPlugin.js +2 -1
- package/lib/InitFragment.js +33 -30
- package/lib/JavascriptMetaInfoPlugin.js +9 -6
- package/lib/LazyBarrel.js +389 -0
- package/lib/LibraryTemplatePlugin.js +2 -1
- package/lib/LoaderOptionsPlugin.js +3 -1
- package/lib/LoaderTargetPlugin.js +3 -1
- package/lib/MainTemplate.js +15 -0
- package/lib/ManifestPlugin.js +9 -2
- package/lib/Module.js +121 -57
- package/lib/ModuleFactory.js +6 -1
- package/lib/ModuleFilenameHelpers.js +18 -4
- package/lib/ModuleGraph.js +69 -2
- package/lib/ModuleGraphConnection.js +9 -0
- package/lib/ModuleInfoHeaderPlugin.js +5 -0
- package/lib/ModuleNotFoundError.js +3 -83
- package/lib/ModuleProfile.js +27 -1
- package/lib/ModuleSourceTypeConstants.js +52 -19
- package/lib/ModuleTemplate.js +10 -0
- package/lib/ModuleTypeConstants.js +20 -4
- package/lib/MultiCompiler.js +59 -4
- package/lib/MultiStats.js +9 -0
- package/lib/MultiWatching.js +6 -0
- package/lib/NoEmitOnErrorsPlugin.js +1 -1
- package/lib/NodeStuffPlugin.js +78 -46
- package/lib/NormalModule.js +519 -206
- package/lib/NormalModuleFactory.js +156 -31
- package/lib/NormalModuleReplacementPlugin.js +3 -1
- package/lib/NullFactory.js +1 -0
- package/lib/OptionsApply.js +1 -0
- package/lib/Parser.js +3 -1
- package/lib/PlatformPlugin.js +2 -1
- package/lib/PrefetchPlugin.js +4 -1
- package/lib/ProgressPlugin.js +351 -161
- package/lib/ProvidePlugin.js +6 -3
- package/lib/RawModule.js +32 -16
- package/lib/RecordIdsPlugin.js +9 -0
- package/lib/RequestShortener.js +8 -0
- package/lib/ResolverFactory.js +5 -0
- package/lib/RuntimeGlobals.js +58 -5
- package/lib/RuntimeModule.js +22 -7
- package/lib/RuntimePlugin.js +123 -118
- package/lib/RuntimeTemplate.js +616 -37
- package/lib/SelfModuleFactory.js +3 -0
- package/lib/SourceMapDevToolModuleOptionsPlugin.js +2 -0
- package/lib/SourceMapDevToolPlugin.js +341 -63
- package/lib/Stats.js +6 -0
- package/lib/Template.js +52 -6
- package/lib/TemplatedPathPlugin.js +505 -138
- package/lib/UseStrictPlugin.js +3 -2
- package/lib/WarnCaseSensitiveModulesPlugin.js +72 -3
- package/lib/WarnDeprecatedOptionPlugin.js +6 -2
- package/lib/WarnNoModeSetPlugin.js +18 -2
- package/lib/WatchIgnorePlugin.js +5 -1
- package/lib/Watching.js +25 -3
- package/lib/WebpackError.js +3 -74
- package/lib/WebpackIsIncludedPlugin.js +4 -2
- package/lib/WebpackOptionsApply.js +88 -25
- package/lib/WebpackOptionsDefaulter.js +1 -0
- package/lib/asset/AssetBytesGenerator.js +28 -10
- package/lib/asset/AssetBytesParser.js +1 -0
- package/lib/asset/AssetGenerator.js +199 -60
- package/lib/asset/AssetModule.js +47 -0
- package/lib/asset/AssetModulesPlugin.js +115 -24
- package/lib/asset/AssetParser.js +4 -2
- package/lib/asset/AssetSourceGenerator.js +26 -8
- package/lib/asset/AssetSourceParser.js +1 -0
- package/lib/asset/RawDataUrlModule.js +23 -13
- package/lib/asset/WebManifestGenerator.js +164 -0
- package/lib/asset/WebManifestParser.js +130 -0
- package/lib/async-modules/AsyncModuleHelpers.js +1 -0
- package/lib/async-modules/AwaitDependenciesInitFragment.js +18 -4
- package/lib/async-modules/InferAsyncModulesPlugin.js +1 -1
- package/lib/async-modules/isGeneratorLowered.js +26 -0
- package/lib/buildChunkGraph.js +107 -15
- package/lib/bun/BunTargetPlugin.js +42 -0
- package/lib/cache/AddBuildDependenciesPlugin.js +3 -1
- package/lib/cache/AddManagedPathsPlugin.js +5 -1
- package/lib/cache/IdleFileCachePlugin.js +6 -1
- package/lib/cache/MemoryCachePlugin.js +1 -1
- package/lib/cache/MemoryWithGcCachePlugin.js +4 -1
- package/lib/cache/PackFileCacheStrategy.js +302 -12
- package/lib/cache/ResolverCachePlugin.js +12 -1
- package/lib/cache/getLazyHashedEtag.js +13 -2
- package/lib/cache/mergeEtags.js +4 -0
- package/lib/cli.js +142 -20
- package/lib/config/browserslistTargetHandler.js +141 -0
- package/lib/config/defaults.js +612 -43
- package/lib/config/defineConfig.js +31 -0
- package/lib/config/normalization.js +46 -1
- package/lib/config/target.js +200 -2
- package/lib/container/ContainerEntryDependency.js +2 -0
- package/lib/container/ContainerEntryModule.js +27 -14
- package/lib/container/ContainerEntryModuleFactory.js +1 -0
- package/lib/container/ContainerExposedDependency.js +6 -2
- package/lib/container/ContainerPlugin.js +2 -1
- package/lib/container/ContainerReferencePlugin.js +3 -2
- package/lib/container/FallbackDependency.js +9 -7
- package/lib/container/FallbackItemDependency.js +1 -0
- package/lib/container/FallbackModule.js +22 -9
- package/lib/container/FallbackModuleFactory.js +1 -0
- package/lib/container/HoistContainerReferencesPlugin.js +47 -55
- package/lib/container/ModuleFederationPlugin.js +21 -29
- package/lib/container/RemoteModule.js +33 -10
- package/lib/container/RemoteRuntimeModule.js +15 -12
- package/lib/container/RemoteToExternalDependency.js +1 -0
- package/lib/container/options.js +7 -0
- package/lib/css/CssGenerator.js +540 -272
- package/lib/css/CssInjectStyleRuntimeModule.js +86 -70
- package/lib/css/CssLoadingRuntimeModule.js +173 -81
- package/lib/{CssModule.js → css/CssModule.js} +72 -37
- package/lib/css/CssModulesPlugin.js +371 -208
- package/lib/css/CssParser.js +3538 -1963
- package/lib/css/syntax.js +4155 -0
- package/lib/debug/ProfilingPlugin.js +33 -2
- package/lib/deno/DenoTargetPlugin.js +41 -0
- package/lib/dependencies/AMDDefineDependency.js +29 -17
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +19 -6
- package/lib/dependencies/AMDPlugin.js +6 -3
- package/lib/dependencies/AMDRequireArrayDependency.js +13 -11
- package/lib/dependencies/AMDRequireContextDependency.js +10 -11
- package/lib/dependencies/AMDRequireDependenciesBlock.js +1 -0
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +28 -14
- package/lib/dependencies/AMDRequireDependency.js +28 -20
- package/lib/dependencies/AMDRequireItemDependency.js +1 -0
- package/lib/dependencies/AMDRuntimeModules.js +3 -0
- package/lib/dependencies/CachedConstDependency.js +9 -1
- package/lib/dependencies/CommonJsDependencyHelpers.js +104 -0
- package/lib/dependencies/CommonJsExportRequireDependency.js +157 -38
- package/lib/dependencies/CommonJsExportsDependency.js +74 -20
- package/lib/dependencies/CommonJsExportsParserPlugin.js +246 -15
- package/lib/dependencies/CommonJsFullRequireDependency.js +91 -27
- package/lib/dependencies/CommonJsImportsParserPlugin.js +189 -24
- package/lib/dependencies/CommonJsPlugin.js +7 -4
- package/lib/dependencies/CommonJsRequireContextDependency.js +13 -13
- package/lib/dependencies/CommonJsRequireDependency.js +135 -13
- package/lib/dependencies/CommonJsSelfReferenceDependency.js +60 -16
- package/lib/dependencies/ConstDependency.js +22 -12
- package/lib/dependencies/ContextDependency.js +13 -2
- package/lib/dependencies/ContextDependencyHelpers.js +7 -4
- package/lib/dependencies/ContextDependencyTemplateAsId.js +2 -1
- package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +1 -0
- package/lib/dependencies/ContextElementDependency.js +27 -14
- package/lib/dependencies/CreateRequireParserPlugin.js +14 -7
- package/lib/dependencies/CreateScriptUrlDependency.js +9 -7
- package/lib/dependencies/CriticalDependencyWarning.js +3 -1
- package/lib/dependencies/CssIcssExportDependency.js +681 -367
- package/lib/dependencies/CssIcssImportDependency.js +62 -17
- package/lib/dependencies/CssIcssSymbolDependency.js +36 -17
- package/lib/dependencies/CssImportDependency.js +37 -1
- package/lib/dependencies/CssUrlDependency.js +87 -14
- package/lib/dependencies/DelegatedSourceDependency.js +1 -0
- package/lib/dependencies/DllEntryDependency.js +12 -13
- package/lib/dependencies/DynamicExports.js +5 -0
- package/lib/dependencies/EntryDependency.js +1 -0
- package/lib/dependencies/ExportBindingInitFragment.js +164 -0
- package/lib/dependencies/ExportsInfoDependency.js +18 -12
- package/lib/dependencies/ExternalModuleDependency.js +13 -5
- package/lib/dependencies/ExternalModuleInitFragment.js +10 -5
- package/lib/dependencies/ExternalModuleInitFragmentDependency.js +19 -12
- package/lib/dependencies/HarmonyAcceptDependency.js +24 -26
- package/lib/dependencies/HarmonyAcceptImportDependency.js +2 -0
- package/lib/dependencies/HarmonyCompatibilityDependency.js +33 -14
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +108 -30
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +34 -3
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +70 -33
- package/lib/dependencies/HarmonyExportExpressionDependency.js +133 -43
- package/lib/dependencies/HarmonyExportHeaderDependency.js +11 -9
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +268 -44
- package/lib/dependencies/HarmonyExportInitFragment.js +28 -20
- package/lib/dependencies/HarmonyExportSpecifierDependency.js +88 -18
- package/lib/dependencies/HarmonyExports.js +6 -1
- package/lib/dependencies/HarmonyImportDependency.js +60 -4
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +139 -146
- package/lib/dependencies/HarmonyImportGuard.js +427 -0
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +22 -1
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +146 -24
- package/lib/{HarmonyLinkingError.js → dependencies/HarmonyLinkingError.js} +6 -3
- package/lib/dependencies/HarmonyModulesPlugin.js +11 -1
- package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +2 -1
- package/lib/dependencies/HtmlEntryDependency.js +1295 -0
- package/lib/dependencies/HtmlInlineHtmlDependency.js +107 -0
- package/lib/dependencies/HtmlInlineScriptDependency.js +126 -0
- package/lib/dependencies/HtmlInlineStyleDependency.js +152 -0
- package/lib/dependencies/HtmlSourceDependency.js +172 -0
- package/lib/dependencies/ImportContextDependency.js +9 -9
- package/lib/dependencies/ImportDependency.js +92 -3
- package/lib/dependencies/ImportEagerDependency.js +2 -0
- package/lib/dependencies/ImportMetaContextDependency.js +1 -0
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +35 -19
- package/lib/dependencies/ImportMetaContextPlugin.js +40 -8
- package/lib/dependencies/ImportMetaGlobDependency.js +81 -0
- package/lib/dependencies/ImportMetaGlobDependencyParserPlugin.js +78 -0
- package/lib/dependencies/ImportMetaGlobHelpers.js +660 -0
- package/lib/dependencies/ImportMetaHotAcceptDependency.js +2 -0
- package/lib/dependencies/ImportMetaHotDeclineDependency.js +2 -0
- package/lib/dependencies/ImportMetaPlugin.js +595 -209
- package/lib/dependencies/ImportMetaResolveDependency.js +90 -0
- package/lib/dependencies/ImportParserPlugin.js +114 -27
- package/lib/dependencies/ImportPhase.js +17 -11
- package/lib/dependencies/ImportPlugin.js +2 -1
- package/lib/dependencies/ImportWeakDependency.js +3 -0
- package/lib/dependencies/JsonExportsDependency.js +15 -10
- package/lib/dependencies/LoaderDependency.js +2 -0
- package/lib/dependencies/LoaderImportDependency.js +3 -0
- package/lib/dependencies/LoaderPlugin.js +9 -2
- package/lib/dependencies/LocalModule.js +15 -12
- package/lib/dependencies/LocalModuleDependency.js +15 -13
- package/lib/dependencies/LocalModulesHelpers.js +3 -0
- package/lib/dependencies/ModuleDecoratorDependency.js +16 -10
- package/lib/dependencies/ModuleDependency.js +14 -0
- package/lib/dependencies/ModuleDependencyTemplateAsId.js +1 -0
- package/lib/dependencies/ModuleDependencyTemplateAsRequireId.js +1 -0
- package/lib/dependencies/ModuleHotAcceptDependency.js +2 -0
- package/lib/dependencies/ModuleHotDeclineDependency.js +2 -0
- package/lib/dependencies/ModuleInitFragmentDependency.js +19 -11
- package/lib/dependencies/NullDependency.js +2 -0
- package/lib/dependencies/PrefetchDependency.js +1 -0
- package/lib/dependencies/ProvidedDependency.js +36 -27
- package/lib/dependencies/PureExpressionDependency.js +14 -10
- package/lib/dependencies/RequireContextDependency.js +1 -0
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +2 -1
- package/lib/dependencies/RequireContextPlugin.js +2 -1
- package/lib/dependencies/RequireEnsureDependenciesBlock.js +1 -0
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +4 -6
- package/lib/dependencies/RequireEnsureDependency.js +16 -13
- package/lib/dependencies/RequireEnsureItemDependency.js +1 -0
- package/lib/dependencies/RequireEnsurePlugin.js +2 -1
- package/lib/dependencies/RequireHeaderDependency.js +7 -4
- package/lib/dependencies/RequireIncludeDependency.js +2 -0
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +11 -12
- package/lib/dependencies/RequireIncludePlugin.js +2 -1
- package/lib/{RequireJsStuffPlugin.js → dependencies/RequireJsStuffPlugin.js} +9 -8
- package/lib/dependencies/RequireResolveContextDependency.js +10 -11
- package/lib/dependencies/RequireResolveDependency.js +2 -0
- package/lib/dependencies/RequireResolveHeaderDependency.js +8 -5
- package/lib/dependencies/RuntimeRequirementsDependency.js +11 -8
- package/lib/dependencies/StaticExportsDependency.js +13 -10
- package/lib/dependencies/SystemPlugin.js +9 -6
- package/lib/dependencies/SystemRuntimeModule.js +1 -0
- package/lib/dependencies/TopLevelAwaitDependency.js +93 -0
- package/lib/dependencies/URLContextDependency.js +8 -7
- package/lib/dependencies/URLDependency.js +157 -33
- package/lib/dependencies/URLPlugin.js +2 -0
- package/lib/dependencies/UnsupportedDependency.js +12 -13
- package/lib/dependencies/WebAssemblyExportImportedDependency.js +15 -16
- package/lib/dependencies/WebAssemblyImportDependency.js +19 -18
- package/lib/dependencies/WebpackIsIncludedDependency.js +3 -0
- package/lib/dependencies/{WorkerPlugin.js → WorkerAndWorkletPlugin.js} +364 -114
- package/lib/dependencies/WorkerDependency.js +111 -27
- package/lib/dependencies/WorkletDependency.js +278 -0
- package/lib/dependencies/getFunctionExpression.js +1 -0
- package/lib/dependencies/processExportInfo.js +14 -11
- package/lib/{DelegatedModule.js → dll/DelegatedModule.js} +71 -44
- package/lib/{DelegatedModuleFactoryPlugin.js → dll/DelegatedModuleFactoryPlugin.js} +27 -4
- package/lib/{DelegatedPlugin.js → dll/DelegatedPlugin.js} +5 -3
- package/lib/{DllEntryPlugin.js → dll/DllEntryPlugin.js} +9 -5
- package/lib/{DllModule.js → dll/DllModule.js} +36 -24
- package/lib/{DllModuleFactory.js → dll/DllModuleFactory.js} +5 -4
- package/lib/{DllPlugin.js → dll/DllPlugin.js} +24 -6
- package/lib/{DllReferencePlugin.js → dll/DllReferencePlugin.js} +26 -18
- package/lib/{LibManifestPlugin.js → dll/LibManifestPlugin.js} +14 -10
- package/lib/electron/ElectronTargetPlugin.js +24 -5
- package/lib/{AbstractMethodError.js → errors/AbstractMethodError.js} +10 -1
- package/lib/{AsyncDependencyToInitialChunkError.js → errors/AsyncDependencyToInitialChunkError.js} +8 -3
- package/lib/errors/BuildCycleError.js +1 -1
- package/lib/{ChunkRenderError.js → errors/ChunkRenderError.js} +1 -1
- package/lib/{CodeGenerationError.js → errors/CodeGenerationError.js} +1 -1
- package/lib/{CommentCompilationWarning.js → errors/CommentCompilationWarning.js} +9 -3
- package/lib/{ConcurrentCompilationError.js → errors/ConcurrentCompilationError.js} +5 -2
- package/lib/{EnvironmentNotSupportAsyncWarning.js → errors/EnvironmentNotSupportAsyncWarning.js} +5 -5
- package/lib/{HookWebpackError.js → errors/HookWebpackError.js} +20 -16
- package/lib/{IgnoreErrorModuleFactory.js → errors/IgnoreErrorModuleFactory.js} +7 -4
- package/lib/{InvalidDependenciesModuleWarning.js → errors/InvalidDependenciesModuleWarning.js} +6 -3
- package/lib/errors/JSONParseError.js +115 -0
- package/lib/errors/LoaderLoadingError.js +20 -0
- package/lib/{ModuleBuildError.js → errors/ModuleBuildError.js} +22 -16
- package/lib/{ModuleDependencyError.js → errors/ModuleDependencyError.js} +10 -3
- package/lib/{ModuleDependencyWarning.js → errors/ModuleDependencyWarning.js} +13 -5
- package/lib/{ModuleError.js → errors/ModuleError.js} +10 -14
- package/lib/{ModuleHashingError.js → errors/ModuleHashingError.js} +5 -1
- package/lib/errors/ModuleNotFoundError.js +94 -0
- package/lib/errors/ModuleParseError.js +141 -0
- package/lib/{ModuleRestoreError.js → errors/ModuleRestoreError.js} +4 -1
- package/lib/{ModuleStoreError.js → errors/ModuleStoreError.js} +5 -1
- package/lib/{ModuleWarning.js → errors/ModuleWarning.js} +13 -14
- package/lib/{NodeStuffInWebError.js → errors/NodeStuffInWebError.js} +7 -5
- package/lib/errors/NonErrorEmittedError.js +30 -0
- package/lib/{UnhandledSchemeError.js → errors/UnhandledSchemeError.js} +9 -2
- package/lib/{UnsupportedFeatureWarning.js → errors/UnsupportedFeatureWarning.js} +4 -3
- package/lib/errors/WebpackError.js +84 -0
- package/lib/esm/ExportWebpackRequireRuntimeModule.js +2 -0
- package/lib/esm/ModuleChunkFormatPlugin.js +52 -15
- package/lib/esm/ModuleChunkLoadingPlugin.js +11 -3
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +80 -52
- package/lib/hmr/HotModuleReplacement.runtime.js +175 -30
- package/lib/hmr/HotModuleReplacementRuntimeModule.js +8 -0
- package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +173 -26
- package/lib/hmr/JavascriptHotModuleReplacementHelper.js +1 -0
- package/lib/hmr/LazyCompilationPlugin.js +154 -7
- package/lib/hmr/lazyCompilationBackend.js +53 -12
- package/lib/html/HtmlGenerator.js +1490 -0
- package/lib/html/HtmlModule.js +41 -0
- package/lib/html/HtmlModulesPlugin.js +1129 -0
- package/lib/html/HtmlParser.js +1970 -0
- package/lib/html/favicon.svg +1 -0
- package/lib/html/syntax.js +9106 -0
- package/lib/ids/ChunkModuleIdRangePlugin.js +3 -1
- package/lib/ids/DeterministicChunkIdsPlugin.js +3 -1
- package/lib/ids/DeterministicModuleIdsPlugin.js +3 -1
- package/lib/ids/HashedModuleIdsPlugin.js +2 -1
- package/lib/ids/IdHelpers.js +49 -12
- package/lib/ids/NamedChunkIdsPlugin.js +3 -1
- package/lib/ids/NamedModuleIdsPlugin.js +3 -1
- package/lib/ids/NaturalChunkIdsPlugin.js +1 -1
- package/lib/ids/NaturalModuleIdsPlugin.js +1 -1
- package/lib/ids/OccurrenceChunkIdsPlugin.js +2 -1
- package/lib/ids/OccurrenceModuleIdsPlugin.js +4 -1
- package/lib/ids/SyncModuleIdsPlugin.js +3 -1
- package/lib/index.js +66 -15
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +5 -6
- package/lib/javascript/BasicEvaluatedExpression.js +370 -49
- package/lib/javascript/ChunkFormatHelpers.js +2 -1
- package/lib/javascript/ChunkHelpers.js +1 -0
- package/lib/javascript/CommonJsChunkFormatPlugin.js +1 -1
- package/lib/javascript/EnableChunkLoadingPlugin.js +6 -1
- package/lib/javascript/JavascriptGenerator.js +213 -51
- package/lib/javascript/JavascriptModule.js +54 -0
- package/lib/javascript/JavascriptModulesPlugin.js +628 -198
- package/lib/javascript/JavascriptParser.js +1334 -471
- package/lib/javascript/JavascriptParserHelpers.js +10 -7
- package/lib/javascript/StartupHelpers.js +5 -0
- package/lib/javascript/syntax.js +5037 -0
- package/lib/json/JsonData.js +5 -0
- package/lib/json/JsonGenerator.js +21 -0
- package/lib/json/JsonModule.js +40 -0
- package/lib/json/JsonModulesPlugin.js +8 -1
- package/lib/json/JsonParser.js +18 -27
- package/lib/library/AbstractLibraryPlugin.js +17 -2
- package/lib/library/AmdLibraryPlugin.js +8 -0
- package/lib/library/AssignLibraryPlugin.js +21 -3
- package/lib/library/EnableLibraryPlugin.js +8 -2
- package/lib/library/ExportPropertyLibraryPlugin.js +10 -0
- package/lib/{FalseIIFEUmdWarning.js → library/FalseIIFEUmdWarning.js} +2 -1
- package/lib/library/JsonpLibraryPlugin.js +8 -0
- package/lib/library/ModuleLibraryPlugin.js +154 -7
- package/lib/library/SystemLibraryPlugin.js +11 -3
- package/lib/library/UmdLibraryPlugin.js +16 -0
- package/lib/loaders/LoaderRunner.js +714 -0
- package/lib/loaders/loadLoader.js +100 -0
- package/lib/logging/Logger.js +17 -0
- package/lib/logging/createConsoleLogger.js +7 -0
- package/lib/logging/runtime.js +2 -0
- package/lib/logging/truncateArgs.js +2 -0
- package/lib/node/CommonJsChunkLoadingPlugin.js +5 -1
- package/lib/node/NodeEnvironmentPlugin.js +7 -3
- package/lib/node/NodeSourcePlugin.js +1 -1
- package/lib/node/NodeTargetPlugin.js +4 -63
- package/lib/node/NodeTemplatePlugin.js +3 -1
- package/lib/node/NodeWatchFileSystem.js +40 -22
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +13 -9
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +33 -3
- package/lib/node/ReadFileCompileWasmPlugin.js +28 -3
- package/lib/node/RequireChunkLoadingRuntimeModule.js +21 -16
- package/lib/node/nodeBuiltins.js +80 -0
- package/lib/node/nodeConsole.js +116 -64
- package/lib/optimize/AggressiveMergingPlugin.js +22 -16
- package/lib/optimize/AggressiveSplittingPlugin.js +6 -1
- package/lib/optimize/ConcatenatedModule.js +603 -130
- package/lib/optimize/ConstExportsPlugin.js +211 -0
- package/lib/optimize/EnsureChunkConditionsPlugin.js +2 -1
- package/lib/optimize/FlagIncludedChunksPlugin.js +15 -4
- package/lib/optimize/InlineExports.js +178 -0
- package/lib/optimize/InnerGraph.js +374 -262
- package/lib/optimize/InnerGraphPlugin.js +246 -117
- package/lib/optimize/LimitChunkCountPlugin.js +9 -0
- package/lib/optimize/MangleExportsPlugin.js +5 -1
- package/lib/optimize/MergeDuplicateChunksPlugin.js +2 -0
- package/lib/optimize/MinChunkSizePlugin.js +2 -1
- package/lib/optimize/MinMaxSizeWarning.js +5 -4
- package/lib/optimize/ModuleConcatenationPlugin.js +229 -55
- package/lib/optimize/RealContentHashPlugin.js +130 -52
- package/lib/optimize/RemoveEmptyChunksPlugin.js +2 -1
- package/lib/optimize/RemoveParentModulesPlugin.js +3 -1
- package/lib/optimize/RuntimeChunkPlugin.js +2 -1
- package/lib/optimize/SideEffectsFlagPlugin.js +381 -55
- package/lib/optimize/SplitChunksPlugin.js +200 -50
- package/lib/performance/AssetsOverSizeLimitWarning.js +3 -2
- package/lib/performance/EntrypointsOverSizeLimitWarning.js +3 -2
- package/lib/performance/NoAsyncChunksWarning.js +5 -3
- package/lib/performance/SizeLimitsPlugin.js +8 -2
- package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +1 -0
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +21 -0
- package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +1 -0
- package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +5 -1
- package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +25 -13
- package/lib/prefetch/ResourceHintPlugin.js +687 -0
- package/lib/prefetch/ResourceHintRuntimeModule.js +149 -0
- package/lib/prefetch/StartupAssetHintRuntimeModule.js +210 -0
- package/lib/prefetch/parseResourceHintOptions.js +103 -0
- package/lib/rules/BasicEffectRulePlugin.js +3 -0
- package/lib/rules/BasicMatcherRulePlugin.js +3 -0
- package/lib/rules/ObjectMatcherRulePlugin.js +3 -0
- package/lib/rules/RuleSetCompiler.js +132 -0
- package/lib/rules/UseEffectRulePlugin.js +10 -3
- package/lib/runtime/AsyncModuleGeneratorRuntimeModule.js +56 -0
- package/lib/runtime/AsyncModuleRuntimeModule.js +52 -33
- package/lib/runtime/AutoPublicPathRuntimeModule.js +22 -9
- package/lib/runtime/BaseUriRuntimeModule.js +1 -0
- package/lib/runtime/ChunkNameRuntimeModule.js +1 -0
- package/lib/runtime/CommonJsWrapRuntimeModule.js +37 -0
- package/lib/runtime/CompatGetDefaultExportRuntimeModule.js +2 -1
- package/lib/runtime/CompatRuntimeModule.js +2 -0
- package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +7 -4
- package/lib/runtime/CreateScriptRuntimeModule.js +1 -0
- package/lib/runtime/CreateScriptUrlRuntimeModule.js +1 -0
- package/lib/runtime/DefinePropertyGettersRuntimeModule.js +34 -4
- package/lib/runtime/EnsureChunkRuntimeModule.js +1 -0
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +88 -8
- package/lib/runtime/GetFullHashRuntimeModule.js +1 -0
- package/lib/runtime/GetMainFilenameRuntimeModule.js +1 -0
- package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +2 -1
- package/lib/runtime/GetWorkletBootstrapRuntimeModule.js +59 -0
- package/lib/runtime/GlobalRuntimeModule.js +1 -0
- package/lib/runtime/HasOwnPropertyRuntimeModule.js +2 -1
- package/lib/runtime/HelperRuntimeModule.js +5 -0
- package/lib/runtime/LoadScriptRuntimeModule.js +28 -37
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +354 -37
- package/lib/runtime/MakeNamespaceObjectRuntimeModule.js +2 -1
- package/lib/runtime/NonceRuntimeModule.js +1 -0
- package/lib/runtime/OnChunksLoadedRuntimeModule.js +5 -4
- package/lib/runtime/PublicPathRuntimeModule.js +1 -0
- package/lib/runtime/RelativeUrlRuntimeModule.js +4 -2
- package/lib/runtime/RuntimeIdRuntimeModule.js +1 -0
- package/lib/runtime/SetAnonymousDefaultNameRuntimeModule.js +38 -0
- package/lib/runtime/StartupChunkDependenciesPlugin.js +13 -1
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +2 -1
- package/lib/runtime/StartupEntrypointRuntimeModule.js +5 -3
- package/lib/runtime/SystemContextRuntimeModule.js +1 -0
- package/lib/runtime/ToBinaryRuntimeModule.js +1 -0
- package/lib/runtime/WorkerRuntimeModule.js +33 -0
- package/lib/schemes/DataUriPlugin.js +14 -2
- package/lib/schemes/FileUriPlugin.js +1 -1
- package/lib/schemes/HttpUriPlugin.js +86 -4
- package/lib/schemes/VirtualUrlPlugin.js +8 -4
- package/lib/serialization/AggregateErrorSerializer.js +9 -6
- package/lib/serialization/ArraySerializer.js +6 -8
- package/lib/serialization/BinaryMiddleware.js +427 -1006
- package/lib/serialization/DateObjectSerializer.js +4 -2
- package/lib/serialization/ErrorObjectSerializer.js +10 -6
- package/lib/serialization/FileMiddleware.js +345 -59
- package/lib/serialization/MapObjectSerializer.js +7 -9
- package/lib/serialization/NullPrototypeObjectSerializer.js +9 -9
- package/lib/serialization/ObjectMiddleware.js +73 -13
- package/lib/serialization/PlainObjectSerializer.js +16 -8
- package/lib/serialization/RegExpObjectSerializer.js +4 -2
- package/lib/serialization/Serializer.js +6 -0
- package/lib/serialization/SerializerMiddleware.js +14 -2
- package/lib/serialization/SetObjectSerializer.js +6 -8
- package/lib/serialization/SingleItemMiddleware.js +3 -0
- package/lib/sharing/ConsumeSharedFallbackDependency.js +1 -0
- package/lib/sharing/ConsumeSharedModule.js +21 -7
- package/lib/sharing/ConsumeSharedPlugin.js +11 -11
- package/lib/sharing/ConsumeSharedRuntimeModule.js +55 -45
- package/lib/sharing/ProvideForSharedDependency.js +1 -0
- package/lib/sharing/ProvideSharedDependency.js +34 -15
- package/lib/sharing/ProvideSharedModule.js +42 -12
- package/lib/sharing/ProvideSharedModuleFactory.js +1 -0
- package/lib/sharing/ProvideSharedPlugin.js +13 -8
- package/lib/sharing/SharePlugin.js +5 -1
- package/lib/sharing/ShareRuntimeModule.js +19 -16
- package/lib/sharing/resolveMatchedConfigs.js +6 -2
- package/lib/sharing/utils.js +9 -1
- package/lib/stats/DefaultStatsFactoryPlugin.js +289 -201
- package/lib/stats/DefaultStatsPresetPlugin.js +14 -2
- package/lib/stats/DefaultStatsPrinterPlugin.js +74 -170
- package/lib/stats/StatsFactory.js +70 -27
- package/lib/stats/StatsPrinter.js +16 -2
- package/lib/typescript/TypeScriptPlugin.js +210 -0
- package/lib/url/URLParserPlugin.js +111 -23
- package/lib/util/ArrayHelpers.js +1 -0
- package/lib/util/ArrayQueue.js +10 -5
- package/lib/util/AsyncQueue.js +154 -74
- package/lib/util/Hash.js +2 -2
- package/lib/util/IterableHelpers.js +3 -0
- package/lib/util/LazyBucketSortedSet.js +26 -0
- package/lib/util/LazySet.js +45 -4
- package/lib/util/LocConverter.js +64 -0
- package/lib/util/ParallelismFactorCalculator.js +1 -0
- package/lib/util/Queue.js +6 -3
- package/lib/util/Semaphore.js +15 -1
- package/lib/util/SetHelpers.js +4 -1
- package/lib/util/SortableSet.js +7 -1
- package/lib/util/SourceProcessor.js +119 -0
- package/lib/util/StackedCacheMap.js +20 -3
- package/lib/util/StackedMap.js +162 -43
- package/lib/util/StringXor.js +1 -1
- package/lib/util/TupleQueue.js +7 -3
- package/lib/util/TupleSet.js +14 -0
- package/lib/util/URLAbsoluteSpecifier.js +1 -0
- package/lib/util/WeakTupleMap.js +60 -1
- package/lib/util/binarySearchBounds.js +3 -2
- package/lib/util/chainedImports.js +3 -3
- package/lib/util/cleverMerge.js +19 -2
- package/lib/util/comparators.js +35 -4
- package/lib/util/compileBooleanMatcher.js +9 -0
- package/lib/util/concatenate.js +80 -24
- package/lib/util/conventions.js +46 -1
- package/lib/util/createHash.js +0 -1
- package/lib/util/createHooksRegistry.js +43 -0
- package/lib/util/createMappings.js +118 -0
- package/lib/util/dataURL.js +3 -2
- package/lib/util/deprecation.js +19 -0
- package/lib/util/deterministicGrouping.js +46 -17
- package/lib/util/extractSourceMap.js +2 -1
- package/lib/util/extractUrlAndGlobal.js +1 -0
- package/lib/util/findGraphRoots.js +7 -0
- package/lib/{formatLocation.js → util/formatLocation.js} +4 -2
- package/lib/{SizeFormatHelpers.js → util/formatSize.js} +10 -3
- package/lib/util/fs.js +87 -14
- package/lib/util/generateDebugId.js +1 -0
- package/lib/util/globUtils.js +710 -0
- package/lib/util/hash/BatchedHash.js +1 -0
- package/lib/util/hash/BulkUpdateHash.js +1 -0
- package/lib/util/hash/DebugHash.js +1 -0
- package/lib/util/hash/hash-digest.js +32 -15
- package/lib/util/hash/md4.js +1 -1
- package/lib/util/hash/wasm-hash.js +5 -0
- package/lib/util/hash/xxhash64.js +1 -1
- package/lib/util/identifier.js +118 -7
- package/lib/util/implicitTypeLoaderFallback.js +62 -0
- package/lib/util/internalSerializables.js +102 -60
- package/lib/util/magicComment.js +149 -7
- package/lib/util/makeSerializable.js +7 -0
- package/lib/util/memoize.js +2 -0
- package/lib/util/mimeTypes.js +176 -0
- package/lib/util/nonNumericOnlyHash.js +31 -1
- package/lib/util/numberHash.js +2 -2
- package/lib/util/parseJson.js +41 -0
- package/lib/util/processAsyncTree.js +8 -0
- package/lib/util/property.js +9 -2
- package/lib/util/publicPathPlaceholder.js +64 -0
- package/lib/util/registerExternalSerializer.js +24 -4
- package/lib/util/removeBOM.js +1 -0
- package/lib/util/runtime.js +32 -0
- package/lib/util/semver.js +15 -0
- package/lib/util/serialization.js +2 -0
- package/lib/util/smartGrouping.js +8 -0
- package/lib/util/source.js +23 -0
- package/lib/util/topologicalSort.js +69 -0
- package/lib/validateSchema.js +1 -0
- package/lib/wasm/EnableWasmLoadingPlugin.js +15 -1
- package/lib/wasm-async/AsyncWasmCompileRuntimeModule.js +25 -18
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +34 -22
- package/lib/wasm-async/AsyncWasmModule.js +77 -0
- package/lib/wasm-async/AsyncWebAssemblyGenerator.js +6 -0
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +6 -1
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +22 -126
- package/lib/wasm-async/AsyncWebAssemblyParser.js +3 -2
- package/lib/wasm-async/UniversalCompileAsyncWasmPlugin.js +13 -2
- package/lib/wasm-sync/SyncWasmModule.js +39 -0
- package/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +7 -3
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +86 -19
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +4 -3
- package/lib/wasm-sync/WebAssemblyGenerator.js +27 -1
- package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +9 -3
- package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +4 -0
- package/lib/wasm-sync/WebAssemblyModulesPlugin.js +20 -1
- package/lib/wasm-sync/WebAssemblyParser.js +9 -3
- package/lib/wasm-sync/WebAssemblyUtils.js +2 -0
- package/lib/web/FetchCompileAsyncWasmPlugin.js +29 -1
- package/lib/web/FetchCompileWasmPlugin.js +27 -1
- package/lib/web/JsonpChunkLoadingPlugin.js +11 -1
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +58 -64
- package/lib/web/JsonpTemplatePlugin.js +2 -1
- package/lib/webpack.js +78 -1
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +10 -1
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +15 -10
- package/lib/webworker/WebWorkerTemplatePlugin.js +1 -1
- package/module.d.ts +21 -0
- package/package.json +79 -77
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +1173 -80
- package/schemas/plugins/{DllPlugin.check.d.ts → HtmlGeneratorOptions.check.d.ts} +1 -1
- package/schemas/plugins/HtmlGeneratorOptions.check.js +6 -0
- package/schemas/plugins/HtmlGeneratorOptions.json +3 -0
- package/schemas/plugins/{DllReferencePlugin.check.d.ts → HtmlParserOptions.check.d.ts} +1 -1
- package/schemas/plugins/HtmlParserOptions.check.js +6 -0
- package/schemas/plugins/HtmlParserOptions.json +3 -0
- package/schemas/plugins/ProgressPlugin.check.js +1 -1
- package/schemas/plugins/ProgressPlugin.json +38 -0
- package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
- package/schemas/plugins/container/ContainerReferencePlugin.json +2 -0
- package/schemas/plugins/container/ExternalsType.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.json +2 -0
- package/schemas/plugins/css/CssAutoOrModuleParserOptions.check.d.ts +7 -0
- package/schemas/plugins/css/CssAutoOrModuleParserOptions.check.js +6 -0
- package/schemas/plugins/css/CssAutoOrModuleParserOptions.json +3 -0
- package/schemas/plugins/css/CssModuleParserOptions.check.js +1 -1
- package/schemas/plugins/css/CssParserOptions.check.js +1 -1
- package/schemas/plugins/dll/DllPlugin.check.d.ts +7 -0
- package/schemas/plugins/dll/DllReferencePlugin.check.d.ts +7 -0
- package/types.d.ts +11053 -3019
- package/lib/CaseSensitiveModulesWarning.js +0 -72
- package/lib/GraphHelpers.js +0 -46
- package/lib/ModuleParseError.js +0 -125
- package/lib/NoModeWarning.js +0 -23
- package/lib/css/CssMergeStyleSheetsRuntimeModule.js +0 -56
- package/lib/css/walkCssTokens.js +0 -1843
- package/lib/util/AppendOnlyStackedSet.js +0 -78
- /package/schemas/plugins/{DllPlugin.check.js → dll/DllPlugin.check.js} +0 -0
- /package/schemas/plugins/{DllPlugin.json → dll/DllPlugin.json} +0 -0
- /package/schemas/plugins/{DllReferencePlugin.check.js → dll/DllReferencePlugin.check.js} +0 -0
- /package/schemas/plugins/{DllReferencePlugin.json → dll/DllReferencePlugin.json} +0 -0
|
@@ -14,6 +14,7 @@ const {
|
|
|
14
14
|
ReplaceSource
|
|
15
15
|
} = require("webpack-sources");
|
|
16
16
|
const ConcatenationScope = require("../ConcatenationScope");
|
|
17
|
+
const Dependency = require("../Dependency");
|
|
17
18
|
const { UsageState } = require("../ExportsInfo");
|
|
18
19
|
const Module = require("../Module");
|
|
19
20
|
const {
|
|
@@ -24,10 +25,12 @@ const { JAVASCRIPT_MODULE_TYPE_ESM } = require("../ModuleTypeConstants");
|
|
|
24
25
|
const RuntimeGlobals = require("../RuntimeGlobals");
|
|
25
26
|
const Template = require("../Template");
|
|
26
27
|
const { DEFAULTS } = require("../config/defaults");
|
|
27
|
-
const HarmonyImportDependency = require("../dependencies/HarmonyImportDependency");
|
|
28
28
|
const { ImportPhaseUtils } = require("../dependencies/ImportPhase");
|
|
29
|
+
const { isCommonJsWrapped } = require("../javascript/JavascriptGenerator");
|
|
29
30
|
const JavascriptParser = require("../javascript/JavascriptParser");
|
|
30
31
|
const {
|
|
32
|
+
getDeferredCycleModuleIds,
|
|
33
|
+
getDeferredCycleModules,
|
|
31
34
|
getMakeDeferredNamespaceModeFromExportsType,
|
|
32
35
|
getOptimizedDeferredModule
|
|
33
36
|
} = require("../runtime/MakeDeferredNamespaceObjectRuntime");
|
|
@@ -43,6 +46,7 @@ const {
|
|
|
43
46
|
getUsedNamesInScopeInfo
|
|
44
47
|
} = require("../util/concatenate");
|
|
45
48
|
const createHash = require("../util/createHash");
|
|
49
|
+
const createHooksRegistry = require("../util/createHooksRegistry");
|
|
46
50
|
const { makePathsRelative } = require("../util/identifier");
|
|
47
51
|
const makeSerializable = require("../util/makeSerializable");
|
|
48
52
|
const { propertyAccess, propertyName } = require("../util/property");
|
|
@@ -54,22 +58,23 @@ const {
|
|
|
54
58
|
runtimeConditionToString,
|
|
55
59
|
subtractRuntimeCondition
|
|
56
60
|
} = require("../util/runtime");
|
|
61
|
+
const { InlinedUsedName } = require("./InlineExports");
|
|
57
62
|
|
|
58
|
-
/** @typedef {import("eslint-scope").Reference} Reference */
|
|
59
|
-
/** @typedef {import("eslint-scope").Scope} Scope */
|
|
60
|
-
/** @typedef {import("eslint-scope").Variable} Variable */
|
|
61
63
|
/** @typedef {import("webpack-sources").Source} Source */
|
|
62
64
|
/** @typedef {import("../config/defaults").WebpackOptionsNormalizedWithDefaults} WebpackOptions */
|
|
63
65
|
/** @typedef {import("../ChunkGraph")} ChunkGraph */
|
|
64
66
|
/** @typedef {import("../CodeGenerationResults")} CodeGenerationResults */
|
|
65
67
|
/** @typedef {import("../Compilation")} Compilation */
|
|
66
68
|
/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */
|
|
69
|
+
/** @typedef {import("../dependencies/ModuleDependency")} ModuleDependency */
|
|
70
|
+
/** @typedef {import("../dependencies/HarmonyImportDependency")} HarmonyImportDependency */
|
|
67
71
|
/** @typedef {import("../DependencyTemplates")} DependencyTemplates */
|
|
68
72
|
/** @typedef {import("../ExportsInfo").ExportInfo} ExportInfo */
|
|
69
73
|
/** @typedef {import("../Module").BuildCallback} BuildCallback */
|
|
70
74
|
/** @typedef {import("../Module").BuildInfo} BuildInfo */
|
|
71
75
|
/** @typedef {import("../Module").FileSystemDependencies} FileSystemDependencies */
|
|
72
76
|
/** @typedef {import("../Module").BuildMeta} BuildMeta */
|
|
77
|
+
/** @typedef {import("../Module").ExportsType} ExportsType */
|
|
73
78
|
/** @typedef {import("../Module").CodeGenerationContext} CodeGenerationContext */
|
|
74
79
|
/** @typedef {import("../Module").CodeGenerationResultData} CodeGenerationResultData */
|
|
75
80
|
/** @typedef {import("../Module").CodeGenerationResult} CodeGenerationResult */
|
|
@@ -80,19 +85,26 @@ const {
|
|
|
80
85
|
/** @typedef {import("../Module").RuntimeRequirements} RuntimeRequirements */
|
|
81
86
|
/** @typedef {import("../Module").SourceTypes} SourceTypes */
|
|
82
87
|
/** @typedef {import("../ModuleGraph")} ModuleGraph */
|
|
88
|
+
/** @typedef {import("../NormalModule")} NormalModule */
|
|
83
89
|
/** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */
|
|
84
90
|
/** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */
|
|
85
91
|
/** @typedef {import("../RequestShortener")} RequestShortener */
|
|
86
92
|
/** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */
|
|
87
93
|
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
|
|
94
|
+
/** @typedef {import("../javascript/JavascriptModule").JavascriptModuleBuildInfo} JavascriptModuleBuildInfo */
|
|
95
|
+
/** @typedef {import("../javascript/JavascriptModule").JavascriptModuleBuildMeta} JavascriptModuleBuildMeta */
|
|
88
96
|
/** @typedef {import("../javascript/JavascriptModulesPlugin").ChunkRenderContext} ChunkRenderContext */
|
|
97
|
+
/** @typedef {import("../javascript/JavascriptModulesPlugin").Scope} Scope */
|
|
98
|
+
/** @typedef {import("../javascript/JavascriptModulesPlugin").Reference} Reference */
|
|
99
|
+
/** @typedef {import("../javascript/JavascriptModulesPlugin").Variable} Variable */
|
|
89
100
|
/** @typedef {import("../javascript/JavascriptParser").Program} Program */
|
|
90
101
|
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
|
|
102
|
+
/** @typedef {import("estree").Identifier} Identifier */
|
|
91
103
|
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
|
92
104
|
/** @typedef {import("../util/Hash")} Hash */
|
|
93
105
|
/** @typedef {import("../util/Hash").HashFunction} HashFunction */
|
|
94
106
|
/** @typedef {import("../util/concatenate").UsedNames} UsedNames */
|
|
95
|
-
/** @typedef {import("../util/concatenate").
|
|
107
|
+
/** @typedef {import("../util/concatenate").UsedNamesInScopeInfo} UsedNamesInScopeInfo */
|
|
96
108
|
/** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */
|
|
97
109
|
/** @typedef {import("../util/identifier").AssociatedObjectForCache} AssociatedObjectForCache */
|
|
98
110
|
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
|
@@ -146,6 +158,7 @@ if (!ReferencerClass.prototype.PropertyDefinition) {
|
|
|
146
158
|
* @property {"concatenated"} type
|
|
147
159
|
* @property {Module} module
|
|
148
160
|
* @property {number} index
|
|
161
|
+
* @property {boolean=} cjsWrapped a "weird" CommonJS module executed via the CJS wrapper runtime helper with real module/exports objects
|
|
149
162
|
* @property {Program | undefined} ast
|
|
150
163
|
* @property {Source | undefined} internalSource
|
|
151
164
|
* @property {ReplaceSource | undefined} source
|
|
@@ -158,6 +171,7 @@ if (!ReferencerClass.prototype.PropertyDefinition) {
|
|
|
158
171
|
* @property {ExportMap | undefined} rawExportMap
|
|
159
172
|
* @property {string=} namespaceExportSymbol
|
|
160
173
|
* @property {string | undefined} namespaceObjectName
|
|
174
|
+
* @property {string | undefined} escapeNamespaceObjectName decoupled namespace object that keeps original export names when the exports are mangled
|
|
161
175
|
* @property {ConcatenationScope | undefined} concatenationScope
|
|
162
176
|
* @property {boolean} interopNamespaceObjectUsed "default-with-named" namespace
|
|
163
177
|
* @property {string | undefined} interopNamespaceObjectName "default-with-named" namespace
|
|
@@ -165,6 +179,8 @@ if (!ReferencerClass.prototype.PropertyDefinition) {
|
|
|
165
179
|
* @property {string | undefined} interopNamespaceObject2Name "default-only" namespace
|
|
166
180
|
* @property {boolean} interopDefaultAccessUsed runtime namespace object that detects "__esModule"
|
|
167
181
|
* @property {string | undefined} interopDefaultAccessName runtime namespace object that detects "__esModule"
|
|
182
|
+
* @property {ExportsType=} exportsTypeStrict memoized getExportsType(strict=true)
|
|
183
|
+
* @property {ExportsType=} exportsTypeNonStrict memoized getExportsType(strict=false)
|
|
168
184
|
*/
|
|
169
185
|
|
|
170
186
|
/**
|
|
@@ -175,6 +191,7 @@ if (!ReferencerClass.prototype.PropertyDefinition) {
|
|
|
175
191
|
* @property {NonDeferAccess} nonDeferAccess
|
|
176
192
|
* @property {number} index
|
|
177
193
|
* @property {string | undefined} name module.exports / harmony namespace object
|
|
194
|
+
* @property {string | undefined} escapeNamespaceObjectName decoupled namespace object that keeps original export names when the exports are mangled
|
|
178
195
|
* @property {string | undefined} deferredName deferred module.exports / harmony namespace object
|
|
179
196
|
* @property {boolean} deferred the module is deferred at least once
|
|
180
197
|
* @property {boolean} deferredNamespaceObjectUsed deferred namespace object that being used in a not-analyzable way so it must be materialized
|
|
@@ -185,6 +202,8 @@ if (!ReferencerClass.prototype.PropertyDefinition) {
|
|
|
185
202
|
* @property {string | undefined} interopNamespaceObject2Name "default-only" namespace
|
|
186
203
|
* @property {boolean} interopDefaultAccessUsed runtime namespace object that detects "__esModule"
|
|
187
204
|
* @property {string | undefined} interopDefaultAccessName runtime namespace object that detects "__esModule"
|
|
205
|
+
* @property {ExportsType=} exportsTypeStrict memoized getExportsType(strict=true)
|
|
206
|
+
* @property {ExportsType=} exportsTypeNonStrict memoized getExportsType(strict=false)
|
|
188
207
|
*/
|
|
189
208
|
|
|
190
209
|
/**
|
|
@@ -280,6 +299,27 @@ const subtractNonDeferAccess = (a, b) => a && !b;
|
|
|
280
299
|
|
|
281
300
|
/** @typedef {Map<Module, ModuleInfo>} ModuleToInfoMap */
|
|
282
301
|
|
|
302
|
+
/**
|
|
303
|
+
* getExportsType memoized on the info, which lives for one codeGeneration.
|
|
304
|
+
* The "dynamic" case walks the module graph, and is queried once per reference.
|
|
305
|
+
* @param {ModuleGraph} moduleGraph the module graph
|
|
306
|
+
* @param {ModuleInfo} info module info
|
|
307
|
+
* @param {boolean | undefined} strict strict harmony module (undefined is treated as non-strict)
|
|
308
|
+
* @returns {ExportsType} the exports type
|
|
309
|
+
*/
|
|
310
|
+
const getExportsType = (moduleGraph, info, strict) => {
|
|
311
|
+
if (strict) {
|
|
312
|
+
if (info.exportsTypeStrict === undefined) {
|
|
313
|
+
info.exportsTypeStrict = info.module.getExportsType(moduleGraph, true);
|
|
314
|
+
}
|
|
315
|
+
return info.exportsTypeStrict;
|
|
316
|
+
}
|
|
317
|
+
if (info.exportsTypeNonStrict === undefined) {
|
|
318
|
+
info.exportsTypeNonStrict = info.module.getExportsType(moduleGraph, false);
|
|
319
|
+
}
|
|
320
|
+
return info.exportsTypeNonStrict;
|
|
321
|
+
};
|
|
322
|
+
|
|
283
323
|
/**
|
|
284
324
|
* @param {ModuleGraph} moduleGraph the module graph
|
|
285
325
|
* @param {ModuleInfo} info module info
|
|
@@ -293,7 +333,7 @@ const subtractNonDeferAccess = (a, b) => a && !b;
|
|
|
293
333
|
* @param {boolean} depDeferred the dependency is deferred
|
|
294
334
|
* @param {boolean | undefined} strictHarmonyModule strictHarmonyModule
|
|
295
335
|
* @param {boolean | undefined} asiSafe asiSafe
|
|
296
|
-
* @param {Set<ExportInfo
|
|
336
|
+
* @param {Set<ExportInfo>=} alreadyVisited alreadyVisited
|
|
297
337
|
* @returns {Binding} the final variable
|
|
298
338
|
*/
|
|
299
339
|
const getFinalBinding = (
|
|
@@ -309,12 +349,9 @@ const getFinalBinding = (
|
|
|
309
349
|
depDeferred,
|
|
310
350
|
strictHarmonyModule,
|
|
311
351
|
asiSafe,
|
|
312
|
-
alreadyVisited
|
|
352
|
+
alreadyVisited
|
|
313
353
|
) => {
|
|
314
|
-
const exportsType =
|
|
315
|
-
moduleGraph,
|
|
316
|
-
strictHarmonyModule
|
|
317
|
-
);
|
|
354
|
+
const exportsType = getExportsType(moduleGraph, info, strictHarmonyModule);
|
|
318
355
|
const moduleDeferred =
|
|
319
356
|
info.type === "external" &&
|
|
320
357
|
info.deferred &&
|
|
@@ -323,6 +360,9 @@ const getFinalBinding = (
|
|
|
323
360
|
if (exportName.length === 0) {
|
|
324
361
|
switch (exportsType) {
|
|
325
362
|
case "default-only":
|
|
363
|
+
// a concatenated CommonJS module has no runtime exports object;
|
|
364
|
+
// its fake namespace is built over the generated namespace object
|
|
365
|
+
if (info.type === "concatenated") neededNamespaceObjects.add(info);
|
|
326
366
|
if (deferred) info.deferredNamespaceObjectUsed = true;
|
|
327
367
|
else info.interopNamespaceObject2Used = true;
|
|
328
368
|
return {
|
|
@@ -336,6 +376,7 @@ const getFinalBinding = (
|
|
|
336
376
|
exportName
|
|
337
377
|
};
|
|
338
378
|
case "default-with-named":
|
|
379
|
+
if (info.type === "concatenated") neededNamespaceObjects.add(info);
|
|
339
380
|
if (deferred) info.deferredNamespaceObjectUsed = true;
|
|
340
381
|
else info.interopNamespaceObjectUsed = true;
|
|
341
382
|
return {
|
|
@@ -362,6 +403,20 @@ const getFinalBinding = (
|
|
|
362
403
|
switch (exportName[0]) {
|
|
363
404
|
case "default":
|
|
364
405
|
exportName = exportName.slice(1);
|
|
406
|
+
if (deferred) {
|
|
407
|
+
// `ns.default` for a deferred default-with-named external
|
|
408
|
+
// module must read through the optimized `.a` getter
|
|
409
|
+
// (which lazily evaluates the module and returns its
|
|
410
|
+
// exports), not the proxy namespace itself — otherwise
|
|
411
|
+
// `typeof ns.default` / `ns.default instanceof X`
|
|
412
|
+
// observe the proxy instead of the actual default.
|
|
413
|
+
return {
|
|
414
|
+
info,
|
|
415
|
+
rawName: `${info.deferredName}.a`,
|
|
416
|
+
ids: exportName,
|
|
417
|
+
exportName
|
|
418
|
+
};
|
|
419
|
+
}
|
|
365
420
|
break;
|
|
366
421
|
case "__esModule":
|
|
367
422
|
return {
|
|
@@ -392,6 +447,18 @@ const getFinalBinding = (
|
|
|
392
447
|
exportName
|
|
393
448
|
};
|
|
394
449
|
}
|
|
450
|
+
if (deferred) {
|
|
451
|
+
// As with default-with-named above, `ns.default` for a
|
|
452
|
+
// deferred default-only external must read through the
|
|
453
|
+
// optimized `.a` getter so that `typeof` / `instanceof`
|
|
454
|
+
// observe the actual default value rather than the proxy.
|
|
455
|
+
return {
|
|
456
|
+
info,
|
|
457
|
+
rawName: `${info.deferredName}.a`,
|
|
458
|
+
ids: exportName,
|
|
459
|
+
exportName
|
|
460
|
+
};
|
|
461
|
+
}
|
|
395
462
|
break;
|
|
396
463
|
}
|
|
397
464
|
case "dynamic":
|
|
@@ -476,6 +543,9 @@ const getFinalBinding = (
|
|
|
476
543
|
}
|
|
477
544
|
const exportsInfo = moduleGraph.getExportsInfo(info.module);
|
|
478
545
|
const exportInfo = exportsInfo.getExportInfo(exportName[0]);
|
|
546
|
+
// Lazily allocate: only the reexport-following recursion below needs it,
|
|
547
|
+
// most calls return before reaching this point.
|
|
548
|
+
if (alreadyVisited === undefined) alreadyVisited = new Set();
|
|
479
549
|
if (alreadyVisited.has(exportInfo)) {
|
|
480
550
|
return {
|
|
481
551
|
info,
|
|
@@ -500,9 +570,7 @@ const getFinalBinding = (
|
|
|
500
570
|
}
|
|
501
571
|
const directExport = info.exportMap && info.exportMap.get(exportId);
|
|
502
572
|
if (directExport) {
|
|
503
|
-
const usedName =
|
|
504
|
-
exportsInfo.getUsedName(exportName, runtime)
|
|
505
|
-
);
|
|
573
|
+
const usedName = exportsInfo.getUsedName(exportName, runtime);
|
|
506
574
|
if (!usedName) {
|
|
507
575
|
return {
|
|
508
576
|
info,
|
|
@@ -511,10 +579,26 @@ const getFinalBinding = (
|
|
|
511
579
|
exportName
|
|
512
580
|
};
|
|
513
581
|
}
|
|
582
|
+
if (usedName instanceof InlinedUsedName) {
|
|
583
|
+
return {
|
|
584
|
+
info,
|
|
585
|
+
// Render the inlined literal only (e.g. `"str"`), not its property
|
|
586
|
+
// suffix: that suffix is returned in `ids` and appended once by
|
|
587
|
+
// getFinalName. Using `usedName.render()` would emit it here too,
|
|
588
|
+
// duplicating the access (e.g. `"str".a.a`).
|
|
589
|
+
rawName: usedName.render(
|
|
590
|
+
Template.toNormalComment(
|
|
591
|
+
`inlined export ${propertyAccess(exportName)}`
|
|
592
|
+
)
|
|
593
|
+
),
|
|
594
|
+
ids: usedName.suffix,
|
|
595
|
+
exportName
|
|
596
|
+
};
|
|
597
|
+
}
|
|
514
598
|
return {
|
|
515
599
|
info,
|
|
516
600
|
name: directExport,
|
|
517
|
-
ids: usedName.slice(1),
|
|
601
|
+
ids: /** @type {ExportName} */ (usedName).slice(1),
|
|
518
602
|
exportName
|
|
519
603
|
};
|
|
520
604
|
}
|
|
@@ -531,6 +615,27 @@ const getFinalBinding = (
|
|
|
531
615
|
moduleToInfoMap.has(module)
|
|
532
616
|
);
|
|
533
617
|
if (reexport === false) {
|
|
618
|
+
// Source module was removed because all its exports were inlined;
|
|
619
|
+
// we render the inlined value here instead of binding to the now-absent module.
|
|
620
|
+
const target = exportInfo.getTarget(moduleGraph);
|
|
621
|
+
if (target && target.export) {
|
|
622
|
+
const usedName = moduleGraph
|
|
623
|
+
.getExportsInfo(target.module)
|
|
624
|
+
.getUsedName([...target.export, ...exportName.slice(1)], runtime);
|
|
625
|
+
if (usedName instanceof InlinedUsedName) {
|
|
626
|
+
return {
|
|
627
|
+
info,
|
|
628
|
+
// Literal only; suffix is appended once via `ids` (see directExport branch).
|
|
629
|
+
rawName: usedName.render(
|
|
630
|
+
Template.toNormalComment(
|
|
631
|
+
`inlined export ${propertyAccess(exportName)}`
|
|
632
|
+
)
|
|
633
|
+
),
|
|
634
|
+
ids: usedName.suffix,
|
|
635
|
+
exportName
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
}
|
|
534
639
|
throw new Error(
|
|
535
640
|
`Target module of reexport from '${info.module.readableIdentifier(
|
|
536
641
|
requestShortener
|
|
@@ -562,7 +667,9 @@ const getFinalBinding = (
|
|
|
562
667
|
alreadyVisited
|
|
563
668
|
);
|
|
564
669
|
}
|
|
565
|
-
|
|
670
|
+
// A wrapped module resolves every export through its live exports
|
|
671
|
+
// alias (namespaceObjectName), same as namespaceExportSymbol modules.
|
|
672
|
+
if (info.namespaceExportSymbol || info.cjsWrapped) {
|
|
566
673
|
const usedName = /** @type {ExportName} */ (
|
|
567
674
|
exportsInfo.getUsedName(exportName, runtime)
|
|
568
675
|
);
|
|
@@ -581,9 +688,7 @@ const getFinalBinding = (
|
|
|
581
688
|
}
|
|
582
689
|
|
|
583
690
|
case "external": {
|
|
584
|
-
const used =
|
|
585
|
-
exportsInfo.getUsedName(exportName, runtime)
|
|
586
|
-
);
|
|
691
|
+
const used = exportsInfo.getUsedName(exportName, runtime);
|
|
587
692
|
if (!used) {
|
|
588
693
|
return {
|
|
589
694
|
info,
|
|
@@ -592,7 +697,21 @@ const getFinalBinding = (
|
|
|
592
697
|
exportName
|
|
593
698
|
};
|
|
594
699
|
}
|
|
595
|
-
|
|
700
|
+
if (used instanceof InlinedUsedName) {
|
|
701
|
+
return {
|
|
702
|
+
info,
|
|
703
|
+
// Literal only; suffix is appended once via `ids` (see directExport branch).
|
|
704
|
+
rawName: used.render(
|
|
705
|
+
Template.toNormalComment(
|
|
706
|
+
`inlined export ${propertyAccess(exportName)}`
|
|
707
|
+
)
|
|
708
|
+
),
|
|
709
|
+
ids: used.suffix,
|
|
710
|
+
exportName
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
const usedName = /** @type {ExportName} */ (used);
|
|
714
|
+
const comment = equals(usedName, exportName)
|
|
596
715
|
? ""
|
|
597
716
|
: Template.toNormalComment(`${exportName.join(".")}`);
|
|
598
717
|
return {
|
|
@@ -601,7 +720,7 @@ const getFinalBinding = (
|
|
|
601
720
|
(deferred ? info.deferredName : info.name) +
|
|
602
721
|
(deferred ? ".a" : "") +
|
|
603
722
|
comment,
|
|
604
|
-
ids:
|
|
723
|
+
ids: usedName,
|
|
605
724
|
exportName
|
|
606
725
|
};
|
|
607
726
|
}
|
|
@@ -699,8 +818,17 @@ const getFinalName = (
|
|
|
699
818
|
|
|
700
819
|
/** @typedef {BuildInfo["topLevelDeclarations"]} TopLevelDeclarations */
|
|
701
820
|
|
|
702
|
-
/**
|
|
703
|
-
|
|
821
|
+
/**
|
|
822
|
+
* Defines the build info properties specific to concatenated modules.
|
|
823
|
+
* @typedef {object} KnownConcatenatedModuleBuildInfo
|
|
824
|
+
* @property {FileSystemDependencies=} fileDependencies
|
|
825
|
+
* @property {FileSystemDependencies=} contextDependencies
|
|
826
|
+
* @property {FileSystemDependencies=} missingDependencies
|
|
827
|
+
* @property {boolean=} needCreateRequire collected from the inner modules
|
|
828
|
+
* @property {boolean=} inlineExports taken over from the root module
|
|
829
|
+
*/
|
|
830
|
+
|
|
831
|
+
/** @typedef {BuildInfo & KnownConcatenatedModuleBuildInfo} ConcatenatedModuleBuildInfo */
|
|
704
832
|
|
|
705
833
|
class ConcatenatedModule extends Module {
|
|
706
834
|
/**
|
|
@@ -735,30 +863,6 @@ class ConcatenatedModule extends Module {
|
|
|
735
863
|
});
|
|
736
864
|
}
|
|
737
865
|
|
|
738
|
-
/**
|
|
739
|
-
* @param {Compilation} compilation the compilation
|
|
740
|
-
* @returns {ConcatenateModuleHooks} the attached hooks
|
|
741
|
-
*/
|
|
742
|
-
static getCompilationHooks(compilation) {
|
|
743
|
-
let hooks = compilationHooksMap.get(compilation);
|
|
744
|
-
if (hooks === undefined) {
|
|
745
|
-
hooks = {
|
|
746
|
-
onDemandExportsGeneration: new SyncBailHook([
|
|
747
|
-
"module",
|
|
748
|
-
"runtimes",
|
|
749
|
-
"exportsFinalName",
|
|
750
|
-
"exportsSource"
|
|
751
|
-
]),
|
|
752
|
-
concatenatedModuleInfo: new SyncBailHook([
|
|
753
|
-
"updatedInfo",
|
|
754
|
-
"concatenatedModuleInfo"
|
|
755
|
-
])
|
|
756
|
-
};
|
|
757
|
-
compilationHooksMap.set(compilation, hooks);
|
|
758
|
-
}
|
|
759
|
-
return hooks;
|
|
760
|
-
}
|
|
761
|
-
|
|
762
866
|
/**
|
|
763
867
|
* @param {object} options options
|
|
764
868
|
* @param {string} options.identifier the identifier of the module
|
|
@@ -770,6 +874,12 @@ class ConcatenatedModule extends Module {
|
|
|
770
874
|
constructor({ identifier, rootModule, modules, runtime, compilation }) {
|
|
771
875
|
super(JAVASCRIPT_MODULE_TYPE_ESM, null, rootModule && rootModule.layer);
|
|
772
876
|
|
|
877
|
+
// Redeclared with the concatenated module specific shape
|
|
878
|
+
/** @type {ConcatenatedModuleBuildInfo | undefined} */
|
|
879
|
+
this.buildInfo = undefined;
|
|
880
|
+
/** @type {JavascriptModuleBuildMeta | undefined} */
|
|
881
|
+
this.buildMeta = undefined;
|
|
882
|
+
|
|
773
883
|
// Info from Factory
|
|
774
884
|
/** @type {string} */
|
|
775
885
|
this._identifier = identifier;
|
|
@@ -777,6 +887,7 @@ class ConcatenatedModule extends Module {
|
|
|
777
887
|
this.rootModule = rootModule;
|
|
778
888
|
/** @type {Set<Module>} */
|
|
779
889
|
this._modules = modules;
|
|
890
|
+
/** @type {RuntimeSpec} */
|
|
780
891
|
this._runtime = runtime;
|
|
781
892
|
this.factoryMeta = rootModule && rootModule.factoryMeta;
|
|
782
893
|
/** @type {Compilation} */
|
|
@@ -795,6 +906,7 @@ class ConcatenatedModule extends Module {
|
|
|
795
906
|
}
|
|
796
907
|
|
|
797
908
|
/**
|
|
909
|
+
* Returns the source types this module can generate.
|
|
798
910
|
* @returns {SourceTypes} types available (do not mutate)
|
|
799
911
|
*/
|
|
800
912
|
getSourceTypes() {
|
|
@@ -806,6 +918,7 @@ class ConcatenatedModule extends Module {
|
|
|
806
918
|
}
|
|
807
919
|
|
|
808
920
|
/**
|
|
921
|
+
* Returns the unique identifier used to reference this module.
|
|
809
922
|
* @returns {string} a unique identifier of the module
|
|
810
923
|
*/
|
|
811
924
|
identifier() {
|
|
@@ -813,16 +926,18 @@ class ConcatenatedModule extends Module {
|
|
|
813
926
|
}
|
|
814
927
|
|
|
815
928
|
/**
|
|
929
|
+
* Returns a human-readable identifier for this module.
|
|
816
930
|
* @param {RequestShortener} requestShortener the request shortener
|
|
817
931
|
* @returns {string} a user readable identifier of the module
|
|
818
932
|
*/
|
|
819
933
|
readableIdentifier(requestShortener) {
|
|
820
|
-
return `${this.rootModule.readableIdentifier(
|
|
821
|
-
|
|
822
|
-
|
|
934
|
+
return `${this.rootModule.readableIdentifier(requestShortener)} + ${
|
|
935
|
+
this._modules.size - 1
|
|
936
|
+
} modules`;
|
|
823
937
|
}
|
|
824
938
|
|
|
825
939
|
/**
|
|
940
|
+
* Gets the library identifier.
|
|
826
941
|
* @param {LibIdentOptions} options options
|
|
827
942
|
* @returns {LibIdent | null} an identifier for library inclusion
|
|
828
943
|
*/
|
|
@@ -831,6 +946,7 @@ class ConcatenatedModule extends Module {
|
|
|
831
946
|
}
|
|
832
947
|
|
|
833
948
|
/**
|
|
949
|
+
* Returns the path used when matching this module against rule conditions.
|
|
834
950
|
* @returns {NameForCondition | null} absolute path which should be used for condition matching (usually the resource path)
|
|
835
951
|
*/
|
|
836
952
|
nameForCondition() {
|
|
@@ -838,6 +954,7 @@ class ConcatenatedModule extends Module {
|
|
|
838
954
|
}
|
|
839
955
|
|
|
840
956
|
/**
|
|
957
|
+
* Gets side effects connection state.
|
|
841
958
|
* @param {ModuleGraph} moduleGraph the module graph
|
|
842
959
|
* @returns {ConnectionState} how this module should be connected to referencing modules when consumed for side-effects only
|
|
843
960
|
*/
|
|
@@ -846,6 +963,7 @@ class ConcatenatedModule extends Module {
|
|
|
846
963
|
}
|
|
847
964
|
|
|
848
965
|
/**
|
|
966
|
+
* Builds the module using the provided compilation context.
|
|
849
967
|
* @param {WebpackOptions} options webpack options
|
|
850
968
|
* @param {Compilation} compilation the compilation
|
|
851
969
|
* @param {ResolverWithOptions} resolver the resolver
|
|
@@ -858,7 +976,7 @@ class ConcatenatedModule extends Module {
|
|
|
858
976
|
const { moduleArgument, exportsArgument } =
|
|
859
977
|
/** @type {BuildInfo} */
|
|
860
978
|
(rootModule.buildInfo);
|
|
861
|
-
/** @type {
|
|
979
|
+
/** @type {ConcatenatedModuleBuildInfo} */
|
|
862
980
|
this.buildInfo = {
|
|
863
981
|
strict: true,
|
|
864
982
|
cacheable: true,
|
|
@@ -868,7 +986,10 @@ class ConcatenatedModule extends Module {
|
|
|
868
986
|
contextDependencies: new LazySet(),
|
|
869
987
|
missingDependencies: new LazySet(),
|
|
870
988
|
topLevelDeclarations: new Set(),
|
|
871
|
-
assets: undefined
|
|
989
|
+
assets: undefined,
|
|
990
|
+
inlineExports: /** @type {JavascriptModuleBuildInfo} */ (
|
|
991
|
+
rootModule.buildInfo
|
|
992
|
+
).inlineExports
|
|
872
993
|
};
|
|
873
994
|
this.buildMeta = rootModule.buildMeta;
|
|
874
995
|
this.clearDependenciesAndBlocks();
|
|
@@ -876,20 +997,46 @@ class ConcatenatedModule extends Module {
|
|
|
876
997
|
|
|
877
998
|
for (const m of this._modules) {
|
|
878
999
|
// populate cacheable
|
|
879
|
-
|
|
1000
|
+
const { cacheable, notCacheableReasons } = /** @type {BuildInfo} */ (
|
|
1001
|
+
m.buildInfo
|
|
1002
|
+
);
|
|
1003
|
+
if (!cacheable) {
|
|
880
1004
|
this.buildInfo.cacheable = false;
|
|
1005
|
+
if (notCacheableReasons) {
|
|
1006
|
+
const reasons =
|
|
1007
|
+
this.buildInfo.notCacheableReasons ||
|
|
1008
|
+
(this.buildInfo.notCacheableReasons = []);
|
|
1009
|
+
for (const reason of notCacheableReasons) {
|
|
1010
|
+
if (!reasons.includes(reason)) reasons.push(reason);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
881
1013
|
}
|
|
882
1014
|
|
|
883
|
-
// populate dependencies
|
|
884
|
-
for (const d of m.dependencies
|
|
885
|
-
(
|
|
886
|
-
!(
|
|
1015
|
+
// populate dependencies — keep only deps that leave the concat set
|
|
1016
|
+
for (const d of m.dependencies) {
|
|
1017
|
+
if (
|
|
1018
|
+
!Dependency.canConcatenate(d) ||
|
|
887
1019
|
!this._modules.has(
|
|
888
1020
|
/** @type {Module} */
|
|
889
|
-
(compilation.moduleGraph.getModule(
|
|
1021
|
+
(compilation.moduleGraph.getModule(d))
|
|
890
1022
|
)
|
|
891
|
-
|
|
892
|
-
|
|
1023
|
+
) {
|
|
1024
|
+
this.dependencies.push(d);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
// populate codeGenerationDependencies — the inner modules'
|
|
1028
|
+
// templates are applied during ConcatenatedModule.codeGeneration,
|
|
1029
|
+
// so the referenced modules must have been code-generated by then.
|
|
1030
|
+
// Skip references that point back into the concat set itself.
|
|
1031
|
+
if (m.codeGenerationDependencies !== undefined) {
|
|
1032
|
+
for (const d of m.codeGenerationDependencies) {
|
|
1033
|
+
const referenced =
|
|
1034
|
+
/** @type {Module} */
|
|
1035
|
+
(compilation.moduleGraph.getModule(d));
|
|
1036
|
+
if (!this._modules.has(referenced)) {
|
|
1037
|
+
this.addCodeGenerationDependency(d);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
893
1040
|
}
|
|
894
1041
|
// populate blocks
|
|
895
1042
|
for (const d of m.blocks) {
|
|
@@ -913,16 +1060,16 @@ class ConcatenatedModule extends Module {
|
|
|
913
1060
|
}
|
|
914
1061
|
|
|
915
1062
|
const { assets, assetsInfo, topLevelDeclarations, needCreateRequire } =
|
|
916
|
-
/** @type {
|
|
1063
|
+
/** @type {JavascriptModuleBuildInfo} */ (m.buildInfo);
|
|
917
1064
|
|
|
918
1065
|
const buildInfo = this.buildInfo;
|
|
919
1066
|
|
|
920
1067
|
// populate topLevelDeclarations
|
|
921
1068
|
if (topLevelDeclarations) {
|
|
922
|
-
const
|
|
923
|
-
if (
|
|
1069
|
+
const mergedTopLevelDeclarations = buildInfo.topLevelDeclarations;
|
|
1070
|
+
if (mergedTopLevelDeclarations !== undefined) {
|
|
924
1071
|
for (const decl of topLevelDeclarations) {
|
|
925
|
-
|
|
1072
|
+
mergedTopLevelDeclarations.add(decl);
|
|
926
1073
|
}
|
|
927
1074
|
}
|
|
928
1075
|
} else {
|
|
@@ -958,6 +1105,7 @@ class ConcatenatedModule extends Module {
|
|
|
958
1105
|
}
|
|
959
1106
|
|
|
960
1107
|
/**
|
|
1108
|
+
* Returns the estimated size for the requested source type.
|
|
961
1109
|
* @param {string=} type the source type for which the size should be estimated
|
|
962
1110
|
* @returns {number} the estimated size of the module (must be non-zero)
|
|
963
1111
|
*/
|
|
@@ -1000,7 +1148,10 @@ class ConcatenatedModule extends Module {
|
|
|
1000
1148
|
*/
|
|
1001
1149
|
const references = connections
|
|
1002
1150
|
.filter((connection) => {
|
|
1003
|
-
if (
|
|
1151
|
+
if (
|
|
1152
|
+
!connection.dependency ||
|
|
1153
|
+
!Dependency.canConcatenate(connection.dependency)
|
|
1154
|
+
) {
|
|
1004
1155
|
return false;
|
|
1005
1156
|
}
|
|
1006
1157
|
if (
|
|
@@ -1243,6 +1394,7 @@ class ConcatenatedModule extends Module {
|
|
|
1243
1394
|
}
|
|
1244
1395
|
|
|
1245
1396
|
/**
|
|
1397
|
+
* Adds the provided file dependencies to the module.
|
|
1246
1398
|
* @param {FileSystemDependencies} fileDependencies set where file dependencies are added to
|
|
1247
1399
|
* @param {FileSystemDependencies} contextDependencies set where context dependencies are added to
|
|
1248
1400
|
* @param {FileSystemDependencies} missingDependencies set where missing dependencies are added to
|
|
@@ -1265,6 +1417,7 @@ class ConcatenatedModule extends Module {
|
|
|
1265
1417
|
}
|
|
1266
1418
|
|
|
1267
1419
|
/**
|
|
1420
|
+
* Generates code and runtime requirements for this module.
|
|
1268
1421
|
* @param {CodeGenerationContext} context context for code generation
|
|
1269
1422
|
* @returns {CodeGenerationResult} result
|
|
1270
1423
|
*/
|
|
@@ -1296,6 +1449,11 @@ class ConcatenatedModule extends Module {
|
|
|
1296
1449
|
/** @type {NeededNamespaceObjects} */
|
|
1297
1450
|
const neededNamespaceObjects = new Set();
|
|
1298
1451
|
|
|
1452
|
+
// Set with modules whose mangled namespace escapes as a whole value and
|
|
1453
|
+
// therefore needs a decoupled namespace object keyed by the original names
|
|
1454
|
+
/** @type {Set<ConcatenatedModuleInfo | ExternalModuleInfo>} */
|
|
1455
|
+
const neededEscapeNamespaceObjects = new Set();
|
|
1456
|
+
|
|
1299
1457
|
// List of all used names to avoid conflicts
|
|
1300
1458
|
const allUsedNames = new Set(RESERVED_NAMES);
|
|
1301
1459
|
|
|
@@ -1321,17 +1479,69 @@ class ConcatenatedModule extends Module {
|
|
|
1321
1479
|
/** @type {TopLevelDeclarations} */
|
|
1322
1480
|
const topLevelDeclarations = new Set();
|
|
1323
1481
|
|
|
1482
|
+
// Free names remaining in the rendered source (runtime globals are
|
|
1483
|
+
// tracked by runtimeRequirements instead)
|
|
1484
|
+
/** @type {Set<string>} */
|
|
1485
|
+
const freeNames = new Set();
|
|
1486
|
+
|
|
1324
1487
|
// List of additional names in scope for module references
|
|
1325
|
-
/** @type {
|
|
1488
|
+
/** @type {UsedNamesInScopeInfo} */
|
|
1326
1489
|
const usedNamesInScopeInfo = new Map();
|
|
1327
1490
|
|
|
1328
1491
|
// Set of already checked scopes
|
|
1329
1492
|
/** @type {Set<Scope>} */
|
|
1330
1493
|
const ignoredScopes = new Set();
|
|
1331
1494
|
|
|
1495
|
+
/**
|
|
1496
|
+
* Lazily allocates a decoupled namespace object for a concatenated module
|
|
1497
|
+
* whose exports are mangled, so an escaping whole-namespace value still
|
|
1498
|
+
* exposes the original export names. Returns undefined when no export is
|
|
1499
|
+
* mangled (the regular namespace object can be used as-is).
|
|
1500
|
+
* @param {ConcatenatedModuleInfo | ExternalModuleInfo} info module info
|
|
1501
|
+
* @returns {string | undefined} the escape namespace object name
|
|
1502
|
+
*/
|
|
1503
|
+
const getEscapeNamespaceObjectName = (info) => {
|
|
1504
|
+
if (info.type === "concatenated" && info.namespaceExportSymbol) {
|
|
1505
|
+
return undefined;
|
|
1506
|
+
}
|
|
1507
|
+
// Deferred external modules keep their special deferred namespace object
|
|
1508
|
+
// and are rendered through a different path that wouldn't emit ours.
|
|
1509
|
+
if (info.type === "external" && info.deferred) return undefined;
|
|
1510
|
+
// Only real ES module namespaces are decoupled; non-harmony modules use
|
|
1511
|
+
// their interop/fake namespace object as before.
|
|
1512
|
+
const buildMeta = /** @type {BuildMeta} */ (info.module.buildMeta);
|
|
1513
|
+
if (!buildMeta || buildMeta.exportsType !== "namespace") return undefined;
|
|
1514
|
+
if (info.escapeNamespaceObjectName !== undefined) {
|
|
1515
|
+
return info.escapeNamespaceObjectName;
|
|
1516
|
+
}
|
|
1517
|
+
const exportsInfo = moduleGraph.getExportsInfo(info.module);
|
|
1518
|
+
let mangled = false;
|
|
1519
|
+
for (const exportInfo of exportsInfo.orderedExports) {
|
|
1520
|
+
if (exportInfo.provided === false) continue;
|
|
1521
|
+
const usedName = exportInfo.getUsedName(undefined, runtime);
|
|
1522
|
+
if (!usedName || usedName instanceof InlinedUsedName) continue;
|
|
1523
|
+
if (usedName[usedName.length - 1] !== exportInfo.name) {
|
|
1524
|
+
mangled = true;
|
|
1525
|
+
break;
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
if (!mangled) return undefined;
|
|
1529
|
+
const name = findNewName(
|
|
1530
|
+
"namespaceObject",
|
|
1531
|
+
allUsedNames,
|
|
1532
|
+
/** @type {UsedNames} */ (new Set()),
|
|
1533
|
+
info.module.readableIdentifier(requestShortener)
|
|
1534
|
+
);
|
|
1535
|
+
allUsedNames.add(name);
|
|
1536
|
+
topLevelDeclarations.add(name);
|
|
1537
|
+
info.escapeNamespaceObjectName = name;
|
|
1538
|
+
neededEscapeNamespaceObjects.add(info);
|
|
1539
|
+
return name;
|
|
1540
|
+
};
|
|
1541
|
+
|
|
1332
1542
|
// get all global names
|
|
1333
1543
|
for (const info of modulesWithInfo) {
|
|
1334
|
-
if (info.type === "concatenated") {
|
|
1544
|
+
if (info.type === "concatenated" && !info.cjsWrapped) {
|
|
1335
1545
|
// ignore symbols from moduleScope
|
|
1336
1546
|
if (info.moduleScope) {
|
|
1337
1547
|
ignoredScopes.add(info.moduleScope);
|
|
@@ -1381,6 +1591,18 @@ class ConcatenatedModule extends Module {
|
|
|
1381
1591
|
if (referencedInfo.type === "reference") {
|
|
1382
1592
|
throw new Error("Module reference can't point to a reference");
|
|
1383
1593
|
}
|
|
1594
|
+
// An escaping mangled namespace resolves to its own decoupled
|
|
1595
|
+
// namespace object (a unique top-level name), so it neither needs
|
|
1596
|
+
// the regular namespace object nor super-class scope handling.
|
|
1597
|
+
if (
|
|
1598
|
+
match.mangleableNamespace &&
|
|
1599
|
+
match.ids.length === 0 &&
|
|
1600
|
+
(referencedInfo.type === "concatenated" ||
|
|
1601
|
+
referencedInfo.type === "external") &&
|
|
1602
|
+
getEscapeNamespaceObjectName(referencedInfo) !== undefined
|
|
1603
|
+
) {
|
|
1604
|
+
continue;
|
|
1605
|
+
}
|
|
1384
1606
|
const binding = getFinalBinding(
|
|
1385
1607
|
moduleGraph,
|
|
1386
1608
|
referencedInfo,
|
|
@@ -1423,6 +1645,7 @@ class ConcatenatedModule extends Module {
|
|
|
1423
1645
|
);
|
|
1424
1646
|
} else {
|
|
1425
1647
|
allUsedNames.add(name);
|
|
1648
|
+
freeNames.add(name);
|
|
1426
1649
|
}
|
|
1427
1650
|
}
|
|
1428
1651
|
}
|
|
@@ -1508,6 +1731,23 @@ class ConcatenatedModule extends Module {
|
|
|
1508
1731
|
);
|
|
1509
1732
|
switch (info.type) {
|
|
1510
1733
|
case "concatenated": {
|
|
1734
|
+
if (info.cjsWrapped) {
|
|
1735
|
+
// Wrapped modules expose one shared-scope name: the final
|
|
1736
|
+
// exports object used as the namespace.
|
|
1737
|
+
const namespaceObjectName = findNewName(
|
|
1738
|
+
"namespaceObject",
|
|
1739
|
+
allUsedNames,
|
|
1740
|
+
namespaceObjectUsedNames,
|
|
1741
|
+
info.module.readableIdentifier(requestShortener)
|
|
1742
|
+
);
|
|
1743
|
+
allUsedNames.add(namespaceObjectName);
|
|
1744
|
+
topLevelDeclarations.add(namespaceObjectName);
|
|
1745
|
+
info.namespaceObjectName = namespaceObjectName;
|
|
1746
|
+
// Route every binding to the live exports alias and skip the
|
|
1747
|
+
// materialized namespace object generated for other modules.
|
|
1748
|
+
info.namespaceExportSymbol = namespaceObjectName;
|
|
1749
|
+
break;
|
|
1750
|
+
}
|
|
1511
1751
|
const variables = /** @type {Scope} */ (info.moduleScope).variables;
|
|
1512
1752
|
for (const variable of variables) {
|
|
1513
1753
|
const name = variable.name;
|
|
@@ -1515,10 +1755,12 @@ class ConcatenatedModule extends Module {
|
|
|
1515
1755
|
const newName = _findNewName(name, info, references);
|
|
1516
1756
|
if (newName) {
|
|
1517
1757
|
const source = /** @type {ReplaceSource} */ (info.source);
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1758
|
+
/** @type {Set<Identifier>} */
|
|
1759
|
+
const allIdentifiers = new Set();
|
|
1760
|
+
for (const r of references) allIdentifiers.add(r.identifier);
|
|
1761
|
+
for (const identifier of variable.identifiers) {
|
|
1762
|
+
allIdentifiers.add(identifier);
|
|
1763
|
+
}
|
|
1522
1764
|
for (const identifier of allIdentifiers) {
|
|
1523
1765
|
const r = /** @type {Range} */ (identifier.range);
|
|
1524
1766
|
const path = getPathInAst(
|
|
@@ -1644,18 +1886,18 @@ class ConcatenatedModule extends Module {
|
|
|
1644
1886
|
|
|
1645
1887
|
// Find and replace references to modules
|
|
1646
1888
|
for (const info of moduleToInfoMap.values()) {
|
|
1647
|
-
if (info.type === "concatenated") {
|
|
1889
|
+
if (info.type === "concatenated" && !info.cjsWrapped) {
|
|
1648
1890
|
const globalScope = /** @type {Scope} */ (info.globalScope);
|
|
1649
1891
|
// group references by name
|
|
1650
1892
|
/** @type {Map<string, Reference[]>} */
|
|
1651
1893
|
const referencesByName = new Map();
|
|
1652
1894
|
for (const reference of globalScope.through) {
|
|
1653
1895
|
const name = reference.identifier.name;
|
|
1654
|
-
|
|
1655
|
-
|
|
1896
|
+
let references = referencesByName.get(name);
|
|
1897
|
+
if (references === undefined) {
|
|
1898
|
+
referencesByName.set(name, (references = []));
|
|
1656
1899
|
}
|
|
1657
|
-
|
|
1658
|
-
(referencesByName.get(name)).push(reference);
|
|
1900
|
+
references.push(reference);
|
|
1659
1901
|
}
|
|
1660
1902
|
for (const [name, references] of referencesByName) {
|
|
1661
1903
|
const match = ConcatenationScope.matchModuleReference(name);
|
|
@@ -1690,22 +1932,35 @@ class ConcatenatedModule extends Module {
|
|
|
1690
1932
|
concatenationScope.setRawExportMap(exportId, newName);
|
|
1691
1933
|
}
|
|
1692
1934
|
}
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1935
|
+
// A whole-namespace value that escapes: when the module's exports
|
|
1936
|
+
// are mangled, point it at a decoupled namespace object that keeps
|
|
1937
|
+
// the original names so untracked access keeps working.
|
|
1938
|
+
const escapeName =
|
|
1939
|
+
match.mangleableNamespace &&
|
|
1940
|
+
match.ids.length === 0 &&
|
|
1941
|
+
(referencedInfo.type === "concatenated" ||
|
|
1942
|
+
referencedInfo.type === "external")
|
|
1943
|
+
? getEscapeNamespaceObjectName(referencedInfo)
|
|
1944
|
+
: undefined;
|
|
1945
|
+
const finalName =
|
|
1946
|
+
escapeName !== undefined
|
|
1947
|
+
? escapeName
|
|
1948
|
+
: getFinalName(
|
|
1949
|
+
moduleGraph,
|
|
1950
|
+
referencedInfo,
|
|
1951
|
+
match.ids,
|
|
1952
|
+
moduleToInfoMap,
|
|
1953
|
+
runtime,
|
|
1954
|
+
requestShortener,
|
|
1955
|
+
runtimeTemplate,
|
|
1956
|
+
neededNamespaceObjects,
|
|
1957
|
+
match.call,
|
|
1958
|
+
match.deferredImport,
|
|
1959
|
+
!match.directImport,
|
|
1960
|
+
/** @type {BuildMeta} */
|
|
1961
|
+
(info.module.buildMeta).strictHarmonyModule,
|
|
1962
|
+
match.asiSafe
|
|
1963
|
+
);
|
|
1709
1964
|
|
|
1710
1965
|
for (const reference of references) {
|
|
1711
1966
|
const r = /** @type {Range} */ (reference.identifier.range);
|
|
@@ -1725,6 +1980,9 @@ class ConcatenatedModule extends Module {
|
|
|
1725
1980
|
// Set with all root exposed unused exports
|
|
1726
1981
|
/** @type {Set<string>} */
|
|
1727
1982
|
const unusedExports = new Set();
|
|
1983
|
+
// Set with all root exposed exports that were substituted with inlined literals
|
|
1984
|
+
/** @type {Set<string>} */
|
|
1985
|
+
const inlinedExports = new Set();
|
|
1728
1986
|
|
|
1729
1987
|
const rootInfo =
|
|
1730
1988
|
/** @type {ConcatenatedModuleInfo} */
|
|
@@ -1743,6 +2001,10 @@ class ConcatenatedModule extends Module {
|
|
|
1743
2001
|
unusedExports.add(name);
|
|
1744
2002
|
continue;
|
|
1745
2003
|
}
|
|
2004
|
+
if (used instanceof InlinedUsedName) {
|
|
2005
|
+
inlinedExports.add(name);
|
|
2006
|
+
continue;
|
|
2007
|
+
}
|
|
1746
2008
|
exportsMap.set(used, (requestShortener) => {
|
|
1747
2009
|
try {
|
|
1748
2010
|
const finalName = getFinalName(
|
|
@@ -1813,9 +2075,9 @@ class ConcatenatedModule extends Module {
|
|
|
1813
2075
|
|
|
1814
2076
|
const exportsSource =
|
|
1815
2077
|
"\n// EXPORTS\n" +
|
|
1816
|
-
`${RuntimeGlobals.definePropertyGetters}(${
|
|
1817
|
-
|
|
1818
|
-
)}\n});\n`;
|
|
2078
|
+
`${RuntimeGlobals.definePropertyGetters}(${
|
|
2079
|
+
this.exportsArgument
|
|
2080
|
+
}, {${definitions.join(",")}\n});\n`;
|
|
1819
2081
|
|
|
1820
2082
|
const { onDemandExportsGeneration } =
|
|
1821
2083
|
ConcatenatedModule.getCompilationHooks(this.compilation);
|
|
@@ -1839,6 +2101,93 @@ class ConcatenatedModule extends Module {
|
|
|
1839
2101
|
);
|
|
1840
2102
|
}
|
|
1841
2103
|
|
|
2104
|
+
// list inlined exports
|
|
2105
|
+
if (inlinedExports.size > 0) {
|
|
2106
|
+
result.add(
|
|
2107
|
+
`\n// INLINED EXPORTS: ${joinIterableWithComma(inlinedExports)}\n`
|
|
2108
|
+
);
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
// generate decoupled namespace objects for escaping mangled namespaces:
|
|
2112
|
+
// same getters as the regular namespace object, but keyed by the original
|
|
2113
|
+
// export names so untracked access by name keeps working. Done before the
|
|
2114
|
+
// regular namespace objects so any nested namespace they pull in is built.
|
|
2115
|
+
/** @type {Map<ConcatenatedModuleInfo | ExternalModuleInfo, string>} */
|
|
2116
|
+
const escapeNamespaceObjectSources = new Map();
|
|
2117
|
+
for (const info of neededEscapeNamespaceObjects) {
|
|
2118
|
+
/** @type {string[]} */
|
|
2119
|
+
const nsObj = [];
|
|
2120
|
+
const exportsInfo = moduleGraph.getExportsInfo(info.module);
|
|
2121
|
+
for (const exportInfo of exportsInfo.orderedExports) {
|
|
2122
|
+
if (exportInfo.provided === false) continue;
|
|
2123
|
+
const usedName = exportInfo.getUsedName(undefined, runtime);
|
|
2124
|
+
if (!usedName) continue;
|
|
2125
|
+
if (usedName instanceof InlinedUsedName) {
|
|
2126
|
+
nsObj.push(
|
|
2127
|
+
`\n ${propertyName(
|
|
2128
|
+
exportInfo.name
|
|
2129
|
+
)}: ${runtimeTemplate.returningFunction(
|
|
2130
|
+
usedName.render(
|
|
2131
|
+
Template.toNormalComment(
|
|
2132
|
+
`inlined export ${propertyAccess([exportInfo.name])}`
|
|
2133
|
+
)
|
|
2134
|
+
)
|
|
2135
|
+
)}`
|
|
2136
|
+
);
|
|
2137
|
+
} else {
|
|
2138
|
+
// External (non-concatenated) modules are accessed through their
|
|
2139
|
+
// import variable; concatenated ones resolve to an internal binding.
|
|
2140
|
+
const finalName =
|
|
2141
|
+
info.type === "external"
|
|
2142
|
+
? `${/** @type {string} */ (info.name)}${propertyAccess([
|
|
2143
|
+
usedName
|
|
2144
|
+
])}`
|
|
2145
|
+
: getFinalName(
|
|
2146
|
+
moduleGraph,
|
|
2147
|
+
info,
|
|
2148
|
+
[exportInfo.name],
|
|
2149
|
+
moduleToInfoMap,
|
|
2150
|
+
runtime,
|
|
2151
|
+
requestShortener,
|
|
2152
|
+
runtimeTemplate,
|
|
2153
|
+
neededNamespaceObjects,
|
|
2154
|
+
false,
|
|
2155
|
+
false,
|
|
2156
|
+
undefined,
|
|
2157
|
+
/** @type {BuildMeta} */
|
|
2158
|
+
(info.module.buildMeta).strictHarmonyModule,
|
|
2159
|
+
true
|
|
2160
|
+
);
|
|
2161
|
+
nsObj.push(
|
|
2162
|
+
`\n ${propertyName(
|
|
2163
|
+
exportInfo.name
|
|
2164
|
+
)}: ${runtimeTemplate.returningFunction(finalName)}`
|
|
2165
|
+
);
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
const name = /** @type {string} */ (info.escapeNamespaceObjectName);
|
|
2169
|
+
const defineGetters =
|
|
2170
|
+
nsObj.length > 0
|
|
2171
|
+
? `${RuntimeGlobals.definePropertyGetters}(${name}, {${nsObj.join(
|
|
2172
|
+
","
|
|
2173
|
+
)}\n});\n`
|
|
2174
|
+
: "";
|
|
2175
|
+
if (nsObj.length > 0) {
|
|
2176
|
+
runtimeRequirements.add(RuntimeGlobals.definePropertyGetters);
|
|
2177
|
+
}
|
|
2178
|
+
escapeNamespaceObjectSources.set(
|
|
2179
|
+
info,
|
|
2180
|
+
`
|
|
2181
|
+
// NAMESPACE OBJECT (decoupled): ${info.module.readableIdentifier(
|
|
2182
|
+
requestShortener
|
|
2183
|
+
)}
|
|
2184
|
+
var ${name} = {};
|
|
2185
|
+
${RuntimeGlobals.makeNamespaceObject}(${name});
|
|
2186
|
+
${defineGetters}`
|
|
2187
|
+
);
|
|
2188
|
+
runtimeRequirements.add(RuntimeGlobals.makeNamespaceObject);
|
|
2189
|
+
}
|
|
2190
|
+
|
|
1842
2191
|
// generate namespace objects
|
|
1843
2192
|
/** @type {Map<ConcatenatedModuleInfo, string>} */
|
|
1844
2193
|
const namespaceObjectSources = new Map();
|
|
@@ -1851,27 +2200,42 @@ class ConcatenatedModule extends Module {
|
|
|
1851
2200
|
if (exportInfo.provided === false) continue;
|
|
1852
2201
|
const usedName = exportInfo.getUsedName(undefined, runtime);
|
|
1853
2202
|
if (usedName) {
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
2203
|
+
// TODO: Replace with the inlined value directly at the call site
|
|
2204
|
+
if (usedName instanceof InlinedUsedName) {
|
|
2205
|
+
nsObj.push(
|
|
2206
|
+
`\n ${propertyName(
|
|
2207
|
+
exportInfo.name
|
|
2208
|
+
)}: ${runtimeTemplate.returningFunction(
|
|
2209
|
+
usedName.render(
|
|
2210
|
+
Template.toNormalComment(
|
|
2211
|
+
`inlined export ${propertyAccess([exportInfo.name])}`
|
|
2212
|
+
)
|
|
2213
|
+
)
|
|
2214
|
+
)}`
|
|
2215
|
+
);
|
|
2216
|
+
} else {
|
|
2217
|
+
const finalName = getFinalName(
|
|
2218
|
+
moduleGraph,
|
|
2219
|
+
info,
|
|
2220
|
+
[exportInfo.name],
|
|
2221
|
+
moduleToInfoMap,
|
|
2222
|
+
runtime,
|
|
2223
|
+
requestShortener,
|
|
2224
|
+
runtimeTemplate,
|
|
2225
|
+
neededNamespaceObjects,
|
|
2226
|
+
false,
|
|
2227
|
+
false,
|
|
2228
|
+
undefined,
|
|
2229
|
+
/** @type {BuildMeta} */
|
|
2230
|
+
(info.module.buildMeta).strictHarmonyModule,
|
|
2231
|
+
true
|
|
2232
|
+
);
|
|
2233
|
+
nsObj.push(
|
|
2234
|
+
`\n ${propertyName(
|
|
2235
|
+
usedName
|
|
2236
|
+
)}: ${runtimeTemplate.returningFunction(finalName)}`
|
|
2237
|
+
);
|
|
2238
|
+
}
|
|
1875
2239
|
}
|
|
1876
2240
|
}
|
|
1877
2241
|
const name = info.namespaceObjectName;
|
|
@@ -1899,26 +2263,43 @@ ${defineGetters}`
|
|
|
1899
2263
|
for (const info of modulesWithInfo) {
|
|
1900
2264
|
if (info.type === "concatenated") {
|
|
1901
2265
|
const source = namespaceObjectSources.get(info);
|
|
1902
|
-
if (
|
|
1903
|
-
|
|
2266
|
+
if (source) result.add(source);
|
|
2267
|
+
const escapeSource = escapeNamespaceObjectSources.get(
|
|
2268
|
+
/** @type {ConcatenatedModuleInfo} */ (info)
|
|
2269
|
+
);
|
|
2270
|
+
if (escapeSource) result.add(escapeSource);
|
|
2271
|
+
if (!source && !escapeSource) continue;
|
|
1904
2272
|
}
|
|
1905
2273
|
|
|
1906
2274
|
if (info.type === "external" && info.deferred) {
|
|
1907
2275
|
const moduleId = JSON.stringify(chunkGraph.getModuleId(info.module));
|
|
1908
2276
|
const loader = getOptimizedDeferredModule(
|
|
1909
2277
|
moduleId,
|
|
1910
|
-
|
|
2278
|
+
getExportsType(
|
|
1911
2279
|
moduleGraph,
|
|
2280
|
+
info,
|
|
1912
2281
|
/** @type {BuildMeta} */
|
|
1913
2282
|
(this.rootModule.buildMeta).strictHarmonyModule
|
|
1914
2283
|
),
|
|
1915
2284
|
// an async module will opt-out of the concat module optimization.
|
|
1916
2285
|
[],
|
|
2286
|
+
// A closure member absorbed into this concatenation shares this
|
|
2287
|
+
// module's runtime id (and thus its `evaluating` flag); resolve it
|
|
2288
|
+
// to that id instead of the member's now-absent standalone id.
|
|
2289
|
+
getDeferredCycleModuleIds(
|
|
2290
|
+
getDeferredCycleModules(moduleGraph, info.module),
|
|
2291
|
+
(mod) =>
|
|
2292
|
+
moduleToInfoMap.has(mod)
|
|
2293
|
+
? chunkGraph.getModuleId(this)
|
|
2294
|
+
: chunkGraph.getModuleId(mod)
|
|
2295
|
+
),
|
|
1917
2296
|
runtimeRequirements
|
|
1918
2297
|
);
|
|
1919
2298
|
runtimeRequirements.add(RuntimeGlobals.require);
|
|
1920
2299
|
result.add(
|
|
1921
|
-
`\n// DEFERRED EXTERNAL MODULE: ${info.module.readableIdentifier(
|
|
2300
|
+
`\n// DEFERRED EXTERNAL MODULE: ${info.module.readableIdentifier(
|
|
2301
|
+
requestShortener
|
|
2302
|
+
)}\nvar ${info.deferredName} = ${loader};`
|
|
1922
2303
|
);
|
|
1923
2304
|
if (info.deferredNamespaceObjectUsed) {
|
|
1924
2305
|
runtimeRequirements.add(RuntimeGlobals.makeDeferredNamespaceObject);
|
|
@@ -1928,7 +2309,7 @@ ${defineGetters}`
|
|
|
1928
2309
|
}(${JSON.stringify(
|
|
1929
2310
|
chunkGraph.getModuleId(info.module)
|
|
1930
2311
|
)}, ${getMakeDeferredNamespaceModeFromExportsType(
|
|
1931
|
-
|
|
2312
|
+
getExportsType(moduleGraph, info, strictHarmonyModule)
|
|
1932
2313
|
)});`
|
|
1933
2314
|
);
|
|
1934
2315
|
}
|
|
@@ -1949,7 +2330,18 @@ ${defineGetters}`
|
|
|
1949
2330
|
result.add(
|
|
1950
2331
|
`\n;// ${info.module.readableIdentifier(requestShortener)}\n`
|
|
1951
2332
|
);
|
|
1952
|
-
|
|
2333
|
+
if (info.cjsWrapped) {
|
|
2334
|
+
// Real CommonJS semantics via the runtime helper: it calls the
|
|
2335
|
+
// body with this = exports and returns the final module.exports.
|
|
2336
|
+
runtimeRequirements.add(RuntimeGlobals.commonJsWrap);
|
|
2337
|
+
result.add(
|
|
2338
|
+
`var ${info.namespaceObjectName} = /*#__PURE__*/${RuntimeGlobals.commonJsWrap}(function(${info.module.moduleArgument}, ${info.module.exportsArgument}) {\n`
|
|
2339
|
+
);
|
|
2340
|
+
result.add(/** @type {ReplaceSource} */ (info.source));
|
|
2341
|
+
result.add("\n});\n");
|
|
2342
|
+
} else {
|
|
2343
|
+
result.add(/** @type {ReplaceSource} */ (info.source));
|
|
2344
|
+
}
|
|
1953
2345
|
if (info.chunkInitFragments) {
|
|
1954
2346
|
for (const f of info.chunkInitFragments) chunkInitFragments.push(f);
|
|
1955
2347
|
}
|
|
@@ -1986,8 +2378,15 @@ ${defineGetters}`
|
|
|
1986
2378
|
const moduleId = JSON.stringify(
|
|
1987
2379
|
chunkGraph.getModuleId(info.module)
|
|
1988
2380
|
);
|
|
2381
|
+
// External module bindings may be wrapped in
|
|
2382
|
+
// runtime-condition `if` blocks but referenced outside,
|
|
2383
|
+
// so they must remain function-scoped (`var`).
|
|
1989
2384
|
result.add(`var ${info.name} = __webpack_require__(${moduleId});`);
|
|
1990
2385
|
name = info.name;
|
|
2386
|
+
// Decoupled namespace object for an escaping mangled external
|
|
2387
|
+
// module must come after its import variable is defined.
|
|
2388
|
+
const escapeSource = escapeNamespaceObjectSources.get(info);
|
|
2389
|
+
if (escapeSource) result.add(escapeSource);
|
|
1991
2390
|
}
|
|
1992
2391
|
// If a module is deferred in other places, but used as non-deferred here,
|
|
1993
2392
|
// the module itself will be emitted as mod_deferred (in the case "external"),
|
|
@@ -1997,7 +2396,9 @@ ${defineGetters}`
|
|
|
1997
2396
|
(rawInfo);
|
|
1998
2397
|
if (info.deferred && nonDeferAccess) {
|
|
1999
2398
|
result.add(
|
|
2000
|
-
`\n// non-deferred import to a deferred module (${info.module.readableIdentifier(
|
|
2399
|
+
`\n// non-deferred import to a deferred module (${info.module.readableIdentifier(
|
|
2400
|
+
requestShortener
|
|
2401
|
+
)})\nvar ${info.name} = ${info.deferredName}.a;`
|
|
2001
2402
|
);
|
|
2002
2403
|
}
|
|
2003
2404
|
break;
|
|
@@ -2035,6 +2436,7 @@ ${defineGetters}`
|
|
|
2035
2436
|
data.set("chunkInitFragments", chunkInitFragments);
|
|
2036
2437
|
}
|
|
2037
2438
|
data.set("topLevelDeclarations", topLevelDeclarations);
|
|
2439
|
+
data.set("freeNames", freeNames);
|
|
2038
2440
|
|
|
2039
2441
|
/** @type {CodeGenerationResult} */
|
|
2040
2442
|
const resultEntry = {
|
|
@@ -2073,6 +2475,33 @@ ${defineGetters}`
|
|
|
2073
2475
|
if (info.type === "concatenated") {
|
|
2074
2476
|
const m = info.module;
|
|
2075
2477
|
try {
|
|
2478
|
+
if (info.cjsWrapped) {
|
|
2479
|
+
// A wrapped module renders its normal module source (real
|
|
2480
|
+
// module/exports objects, own module ids) inside an IIFE, so it
|
|
2481
|
+
// needs no concatenation scope, reference rewriting, or scope
|
|
2482
|
+
// analysis — the wrapper isolates its top-level declarations.
|
|
2483
|
+
const codeGenResult = m.codeGeneration({
|
|
2484
|
+
dependencyTemplates,
|
|
2485
|
+
runtimeTemplate,
|
|
2486
|
+
moduleGraph,
|
|
2487
|
+
chunkGraph,
|
|
2488
|
+
runtime,
|
|
2489
|
+
runtimes,
|
|
2490
|
+
codeGenerationResults,
|
|
2491
|
+
sourceTypes: JAVASCRIPT_TYPES
|
|
2492
|
+
});
|
|
2493
|
+
const source =
|
|
2494
|
+
/** @type {Source} */
|
|
2495
|
+
(codeGenResult.sources.get(JAVASCRIPT_TYPE));
|
|
2496
|
+
const data = codeGenResult.data;
|
|
2497
|
+
info.runtimeRequirements =
|
|
2498
|
+
/** @type {ReadOnlyRuntimeRequirements} */
|
|
2499
|
+
(codeGenResult.runtimeRequirements);
|
|
2500
|
+
info.internalSource = source;
|
|
2501
|
+
info.source = new ReplaceSource(source);
|
|
2502
|
+
info.chunkInitFragments = data && data.get("chunkInitFragments");
|
|
2503
|
+
return;
|
|
2504
|
+
}
|
|
2076
2505
|
// Create a concatenation scope to track and capture information
|
|
2077
2506
|
const concatenationScope = new ConcatenationScope(
|
|
2078
2507
|
modulesMap,
|
|
@@ -2080,7 +2509,8 @@ ${defineGetters}`
|
|
|
2080
2509
|
usedNames
|
|
2081
2510
|
);
|
|
2082
2511
|
|
|
2083
|
-
//
|
|
2512
|
+
// Not cached: Compilation memoizes the outer codeGeneration per
|
|
2513
|
+
// (module, runtime), so inner generation never recomputes usefully.
|
|
2084
2514
|
const codeGenResult = m.codeGeneration({
|
|
2085
2515
|
dependencyTemplates,
|
|
2086
2516
|
runtimeTemplate,
|
|
@@ -2103,11 +2533,17 @@ ${defineGetters}`
|
|
|
2103
2533
|
let ast;
|
|
2104
2534
|
|
|
2105
2535
|
try {
|
|
2536
|
+
const { experiments } = this.compilation.options;
|
|
2537
|
+
|
|
2106
2538
|
({ ast } = JavascriptParser._parse(
|
|
2107
2539
|
code,
|
|
2108
2540
|
{
|
|
2109
2541
|
sourceType: "module",
|
|
2110
|
-
ranges: true
|
|
2542
|
+
ranges: true,
|
|
2543
|
+
// generated code contains phase imports when the experiments are on
|
|
2544
|
+
importPhases: Boolean(
|
|
2545
|
+
experiments.deferImport || experiments.sourceImport
|
|
2546
|
+
)
|
|
2111
2547
|
},
|
|
2112
2548
|
JavascriptParser._getModuleParseFunction(this.compilation, m)
|
|
2113
2549
|
));
|
|
@@ -2180,7 +2616,11 @@ ${defineGetters}`
|
|
|
2180
2616
|
type: "concatenated",
|
|
2181
2617
|
module: info.module,
|
|
2182
2618
|
index,
|
|
2619
|
+
cjsWrapped: isCommonJsWrapped(
|
|
2620
|
+
/** @type {NormalModule} */ (info.module)
|
|
2621
|
+
),
|
|
2183
2622
|
ast: undefined,
|
|
2623
|
+
chunkInitFragments: undefined,
|
|
2184
2624
|
internalSource: undefined,
|
|
2185
2625
|
runtimeRequirements: undefined,
|
|
2186
2626
|
source: undefined,
|
|
@@ -2191,13 +2631,16 @@ ${defineGetters}`
|
|
|
2191
2631
|
rawExportMap: undefined,
|
|
2192
2632
|
namespaceExportSymbol: undefined,
|
|
2193
2633
|
namespaceObjectName: undefined,
|
|
2634
|
+
escapeNamespaceObjectName: undefined,
|
|
2194
2635
|
interopNamespaceObjectUsed: false,
|
|
2195
2636
|
interopNamespaceObjectName: undefined,
|
|
2196
2637
|
interopNamespaceObject2Used: false,
|
|
2197
2638
|
interopNamespaceObject2Name: undefined,
|
|
2198
2639
|
interopDefaultAccessUsed: false,
|
|
2199
2640
|
interopDefaultAccessName: undefined,
|
|
2200
|
-
concatenationScope: undefined
|
|
2641
|
+
concatenationScope: undefined,
|
|
2642
|
+
exportsTypeStrict: undefined,
|
|
2643
|
+
exportsTypeNonStrict: undefined
|
|
2201
2644
|
};
|
|
2202
2645
|
break;
|
|
2203
2646
|
case "external":
|
|
@@ -2208,6 +2651,7 @@ ${defineGetters}`
|
|
|
2208
2651
|
nonDeferAccess: info.nonDeferAccess,
|
|
2209
2652
|
index,
|
|
2210
2653
|
name: undefined,
|
|
2654
|
+
escapeNamespaceObjectName: undefined,
|
|
2211
2655
|
deferredName: undefined,
|
|
2212
2656
|
interopNamespaceObjectUsed: false,
|
|
2213
2657
|
interopNamespaceObjectName: undefined,
|
|
@@ -2215,9 +2659,13 @@ ${defineGetters}`
|
|
|
2215
2659
|
interopNamespaceObject2Name: undefined,
|
|
2216
2660
|
interopDefaultAccessUsed: false,
|
|
2217
2661
|
interopDefaultAccessName: undefined,
|
|
2218
|
-
deferred:
|
|
2662
|
+
deferred: this.compilation.options.experiments.deferImport
|
|
2663
|
+
? moduleGraph.isDeferred(info.module)
|
|
2664
|
+
: false,
|
|
2219
2665
|
deferredNamespaceObjectName: undefined,
|
|
2220
|
-
deferredNamespaceObjectUsed: false
|
|
2666
|
+
deferredNamespaceObjectUsed: false,
|
|
2667
|
+
exportsTypeStrict: undefined,
|
|
2668
|
+
exportsTypeNonStrict: undefined
|
|
2221
2669
|
};
|
|
2222
2670
|
break;
|
|
2223
2671
|
default:
|
|
@@ -2244,6 +2692,7 @@ ${defineGetters}`
|
|
|
2244
2692
|
}
|
|
2245
2693
|
|
|
2246
2694
|
/**
|
|
2695
|
+
* Updates the hash with the data contributed by this instance.
|
|
2247
2696
|
* @param {Hash} hash the hash used to track dependencies
|
|
2248
2697
|
* @param {UpdateHashContext} context context
|
|
2249
2698
|
* @returns {void}
|
|
@@ -2261,8 +2710,16 @@ ${defineGetters}`
|
|
|
2261
2710
|
info.module.updateHash(hash, context);
|
|
2262
2711
|
break;
|
|
2263
2712
|
case "external":
|
|
2264
|
-
hash.update(
|
|
2265
|
-
|
|
2713
|
+
hash.update(
|
|
2714
|
+
`${chunkGraph.getModuleId(info.module)}|${runtimeConditionToString(
|
|
2715
|
+
info.runtimeCondition
|
|
2716
|
+
)}|${info.nonDeferAccess ? "1" : "0"}|${
|
|
2717
|
+
this.compilation.options.experiments.deferImport &&
|
|
2718
|
+
chunkGraph.moduleGraph.isDeferred(info.module)
|
|
2719
|
+
? "1"
|
|
2720
|
+
: "0"
|
|
2721
|
+
}`
|
|
2722
|
+
);
|
|
2266
2723
|
break;
|
|
2267
2724
|
}
|
|
2268
2725
|
}
|
|
@@ -2286,6 +2743,22 @@ ${defineGetters}`
|
|
|
2286
2743
|
}
|
|
2287
2744
|
}
|
|
2288
2745
|
|
|
2746
|
+
ConcatenatedModule.getCompilationHooks = createHooksRegistry(
|
|
2747
|
+
() =>
|
|
2748
|
+
/** @type {ConcatenateModuleHooks} */ ({
|
|
2749
|
+
onDemandExportsGeneration: new SyncBailHook([
|
|
2750
|
+
"module",
|
|
2751
|
+
"runtimes",
|
|
2752
|
+
"exportsFinalName",
|
|
2753
|
+
"exportsSource"
|
|
2754
|
+
]),
|
|
2755
|
+
concatenatedModuleInfo: new SyncBailHook([
|
|
2756
|
+
"updatedInfo",
|
|
2757
|
+
"concatenatedModuleInfo"
|
|
2758
|
+
])
|
|
2759
|
+
})
|
|
2760
|
+
);
|
|
2761
|
+
|
|
2289
2762
|
makeSerializable(ConcatenatedModule, "webpack/lib/optimize/ConcatenatedModule");
|
|
2290
2763
|
|
|
2291
2764
|
module.exports = ConcatenatedModule;
|