@module-federation/enhanced 2.0.1 → 2.2.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/dist/CHANGELOG.md +2357 -0
- package/dist/README.md +213 -0
- package/dist/rstestmigrate.md +140 -0
- package/dist/src/_virtual/_rolldown/runtime.js +47 -0
- package/dist/src/index.d.ts +22 -19
- package/dist/src/index.js +47 -43
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/Constants.d.ts +25 -29
- package/dist/src/lib/Constants.js +136 -116
- package/dist/src/lib/Constants.js.map +1 -1
- package/dist/src/lib/container/AsyncBoundaryPlugin.d.ts +20 -16
- package/dist/src/lib/container/AsyncBoundaryPlugin.js +137 -196
- package/dist/src/lib/container/AsyncBoundaryPlugin.js.map +1 -1
- package/dist/src/lib/container/ContainerEntryDependency.d.ts +28 -23
- package/dist/src/lib/container/ContainerEntryDependency.js +39 -39
- package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -1
- package/dist/src/lib/container/ContainerEntryModule.d.ts +93 -84
- package/dist/src/lib/container/ContainerEntryModule.js +219 -234
- package/dist/src/lib/container/ContainerEntryModule.js.map +1 -1
- package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +15 -10
- package/dist/src/lib/container/ContainerEntryModuleFactory.js +21 -25
- package/dist/src/lib/container/ContainerEntryModuleFactory.js.map +1 -1
- package/dist/src/lib/container/ContainerExposedDependency.d.ts +29 -24
- package/dist/src/lib/container/ContainerExposedDependency.js +47 -47
- package/dist/src/lib/container/ContainerExposedDependency.js.map +1 -1
- package/dist/src/lib/container/ContainerPlugin.d.ts +12 -8
- package/dist/src/lib/container/ContainerPlugin.js +147 -211
- package/dist/src/lib/container/ContainerPlugin.js.map +1 -1
- package/dist/src/lib/container/ContainerReferencePlugin.d.ts +16 -12
- package/dist/src/lib/container/ContainerReferencePlugin.js +74 -102
- package/dist/src/lib/container/ContainerReferencePlugin.js.map +1 -1
- package/dist/src/lib/container/FallbackDependency.d.ts +24 -19
- package/dist/src/lib/container/FallbackDependency.js +46 -44
- package/dist/src/lib/container/FallbackDependency.js.map +1 -1
- package/dist/src/lib/container/FallbackItemDependency.d.ts +13 -8
- package/dist/src/lib/container/FallbackItemDependency.js +24 -24
- package/dist/src/lib/container/FallbackItemDependency.js.map +1 -1
- package/dist/src/lib/container/FallbackModule.d.ts +82 -71
- package/dist/src/lib/container/FallbackModule.js +133 -145
- package/dist/src/lib/container/FallbackModule.js.map +1 -1
- package/dist/src/lib/container/FallbackModuleFactory.d.ts +15 -10
- package/dist/src/lib/container/FallbackModuleFactory.js +20 -24
- package/dist/src/lib/container/FallbackModuleFactory.js.map +1 -1
- package/dist/src/lib/container/HoistContainerReferencesPlugin.d.ts +11 -7
- package/dist/src/lib/container/HoistContainerReferencesPlugin.js +125 -188
- package/dist/src/lib/container/HoistContainerReferencesPlugin.js.map +1 -1
- package/dist/src/lib/container/ModuleFederationPlugin.d.ts +20 -16
- package/dist/src/lib/container/ModuleFederationPlugin.js +143 -180
- package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -1
- package/dist/src/lib/container/RemoteModule.d.ts +79 -74
- package/dist/src/lib/container/RemoteModule.js +143 -153
- package/dist/src/lib/container/RemoteModule.js.map +1 -1
- package/dist/src/lib/container/RemoteRuntimeModule.d.ts +12 -7
- package/dist/src/lib/container/RemoteRuntimeModule.js +86 -120
- package/dist/src/lib/container/RemoteRuntimeModule.js.map +1 -1
- package/dist/src/lib/container/RemoteToExternalDependency.d.ts +13 -8
- package/dist/src/lib/container/RemoteToExternalDependency.js +25 -23
- package/dist/src/lib/container/RemoteToExternalDependency.js.map +1 -1
- package/dist/src/lib/container/constant.d.ts +3 -0
- package/dist/src/lib/container/constant.js +11 -14
- package/dist/src/lib/container/constant.js.map +1 -1
- package/dist/src/lib/container/options.d.ts +7 -3
- package/dist/src/lib/container/options.js +51 -69
- package/dist/src/lib/container/options.js.map +1 -1
- package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.d.ts +14 -9
- package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.js +56 -64
- package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.js.map +1 -1
- package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.d.ts +23 -19
- package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.js +71 -101
- package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.js.map +1 -1
- package/dist/src/lib/container/runtime/FederationModulesPlugin.d.ts +20 -16
- package/dist/src/lib/container/runtime/FederationModulesPlugin.js +55 -47
- package/dist/src/lib/container/runtime/FederationModulesPlugin.js.map +1 -1
- package/dist/src/lib/container/runtime/FederationRuntimeDependency.d.ts +9 -4
- package/dist/src/lib/container/runtime/FederationRuntimeDependency.js +16 -12
- package/dist/src/lib/container/runtime/FederationRuntimeDependency.js.map +1 -1
- package/dist/src/lib/container/runtime/FederationRuntimeModule.d.ts +16 -11
- package/dist/src/lib/container/runtime/FederationRuntimeModule.js +39 -46
- package/dist/src/lib/container/runtime/FederationRuntimeModule.js.map +1 -1
- package/dist/src/lib/container/runtime/FederationRuntimePlugin.d.ts +31 -18
- package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +266 -345
- package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -1
- package/dist/src/lib/container/runtime/getFederationGlobal.d.ts +9 -4
- package/dist/src/lib/container/runtime/getFederationGlobal.js +43 -41
- package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -1
- package/dist/src/lib/container/runtime/utils.d.ts +24 -13
- package/dist/src/lib/container/runtime/utils.js +83 -101
- package/dist/src/lib/container/runtime/utils.js.map +1 -1
- package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +15 -10
- package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js +27 -25
- package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +1 -1
- package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +77 -68
- package/dist/src/lib/sharing/ConsumeSharedModule.js +186 -214
- package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -1
- package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +13 -9
- package/dist/src/lib/sharing/ConsumeSharedPlugin.js +308 -475
- package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -1
- package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +16 -11
- package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +107 -125
- package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -1
- package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +14 -9
- package/dist/src/lib/sharing/ProvideForSharedDependency.js +25 -25
- package/dist/src/lib/sharing/ProvideForSharedDependency.js.map +1 -1
- package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +44 -39
- package/dist/src/lib/sharing/ProvideSharedDependency.js +72 -76
- package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -1
- package/dist/src/lib/sharing/ProvideSharedModule.d.ts +91 -82
- package/dist/src/lib/sharing/ProvideSharedModule.js +177 -184
- package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -1
- package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +14 -9
- package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +19 -25
- package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -1
- package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +27 -21
- package/dist/src/lib/sharing/ProvideSharedPlugin.js +341 -550
- package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -1
- package/dist/src/lib/sharing/SharePlugin.d.ts +53 -49
- package/dist/src/lib/sharing/SharePlugin.js +86 -100
- package/dist/src/lib/sharing/SharePlugin.js.map +1 -1
- package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +12 -7
- package/dist/src/lib/sharing/ShareRuntimeModule.js +81 -100
- package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -1
- package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +11 -7
- package/dist/src/lib/sharing/resolveMatchedConfigs.js +58 -71
- package/dist/src/lib/sharing/resolveMatchedConfigs.js.map +1 -1
- package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.d.ts +18 -14
- package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js +74 -128
- package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js.map +1 -1
- package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.d.ts +39 -34
- package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js +234 -322
- package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js.map +1 -1
- package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.d.ts +16 -11
- package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js +30 -28
- package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js.map +1 -1
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.d.ts +28 -24
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js +91 -95
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js.map +1 -1
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.d.ts +29 -24
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js +47 -43
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js.map +1 -1
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.d.ts +20 -15
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js +33 -29
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js.map +1 -1
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.d.ts +85 -77
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js +141 -153
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js.map +1 -1
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.d.ts +15 -10
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js +20 -24
- package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js.map +1 -1
- package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.d.ts +21 -16
- package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js +157 -231
- package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js.map +1 -1
- package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.d.ts +14 -9
- package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js +26 -27
- package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js.map +1 -1
- package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.d.ts +18 -13
- package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js +41 -49
- package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js.map +1 -1
- package/dist/src/lib/sharing/utils.d.ts +27 -24
- package/dist/src/lib/sharing/utils.js +224 -367
- package/dist/src/lib/sharing/utils.js.map +1 -1
- package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.d.ts +11 -7
- package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js +56 -75
- package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js.map +1 -1
- package/dist/src/lib/startup/StartupHelpers.d.ts +11 -6
- package/dist/src/lib/startup/StartupHelpers.js +128 -178
- package/dist/src/lib/startup/StartupHelpers.js.map +1 -1
- package/dist/src/prefetch.d.ts +3 -2
- package/dist/src/prefetch.js +17 -8
- package/dist/src/rspack.d.ts +3 -2
- package/dist/src/rspack.js +35 -11
- package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +8 -4
- package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -16
- package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -1
- package/dist/src/runtime.d.ts +1 -1
- package/dist/src/runtime.js +11 -18
- package/dist/src/schemas/container/ContainerPlugin.check.d.ts +13 -5
- package/dist/src/schemas/container/ContainerPlugin.check.js +958 -1218
- package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -1
- package/dist/src/schemas/container/ContainerPlugin.d.ts +271 -268
- package/dist/src/schemas/container/ContainerPlugin.js +273 -361
- package/dist/src/schemas/container/ContainerPlugin.js.map +1 -1
- package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +13 -5
- package/dist/src/schemas/container/ContainerReferencePlugin.check.js +335 -443
- package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -1
- package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +102 -99
- package/dist/src/schemas/container/ContainerReferencePlugin.js +122 -162
- package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -1
- package/dist/src/schemas/container/ExternalsType.check.d.ts +13 -5
- package/dist/src/schemas/container/ExternalsType.check.js +36 -62
- package/dist/src/schemas/container/ExternalsType.check.js.map +1 -1
- package/dist/src/schemas/container/ExternalsType.d.ts +5 -2
- package/dist/src/schemas/container/ExternalsType.js +8 -11
- package/dist/src/schemas/container/ExternalsType.js.map +1 -1
- package/dist/src/schemas/container/ModuleFederationPlugin.check.js +3001 -4812
- package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -1
- package/dist/src/schemas/container/ModuleFederationPlugin.d.ts +819 -814
- package/dist/src/schemas/container/ModuleFederationPlugin.js +780 -1053
- package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -1
- package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.d.ts +13 -5
- package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js +568 -768
- package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js.map +1 -1
- package/dist/src/schemas/sharing/ConsumeSharedPlugin.d.ts +197 -194
- package/dist/src/schemas/sharing/ConsumeSharedPlugin.js +212 -238
- package/dist/src/schemas/sharing/ConsumeSharedPlugin.js.map +1 -1
- package/dist/src/schemas/sharing/ProvideSharedPlugin.check.d.ts +13 -5
- package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js +598 -804
- package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js.map +1 -1
- package/dist/src/schemas/sharing/ProvideSharedPlugin.d.ts +184 -181
- package/dist/src/schemas/sharing/ProvideSharedPlugin.js +196 -229
- package/dist/src/schemas/sharing/ProvideSharedPlugin.js.map +1 -1
- package/dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts +12 -4
- package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +285 -482
- package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -1
- package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +103 -100
- package/dist/src/schemas/sharing/ProviderSharedPlugin.js +104 -126
- package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -1
- package/dist/src/schemas/sharing/SharePlugin.check.d.ts +13 -5
- package/dist/src/schemas/sharing/SharePlugin.check.js +749 -965
- package/dist/src/schemas/sharing/SharePlugin.check.js.map +1 -1
- package/dist/src/schemas/sharing/SharePlugin.d.ts +245 -242
- package/dist/src/schemas/sharing/SharePlugin.js +256 -293
- package/dist/src/schemas/sharing/SharePlugin.js.map +1 -1
- package/dist/src/utils.d.ts +3 -0
- package/dist/src/utils.js +35 -26
- package/dist/src/utils.js.map +1 -1
- package/dist/src/webpack.d.ts +2 -2
- package/dist/src/webpack.js +6 -40
- package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +9 -4
- package/dist/src/wrapper/AsyncBoundaryPlugin.js +12 -11
- package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -1
- package/dist/src/wrapper/BaseWrapperPlugin.d.ts +18 -13
- package/dist/src/wrapper/BaseWrapperPlugin.js +39 -39
- package/dist/src/wrapper/BaseWrapperPlugin.js.map +1 -1
- package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +10 -4
- package/dist/src/wrapper/ConsumeSharedPlugin.js +12 -11
- package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -1
- package/dist/src/wrapper/ContainerPlugin.d.ts +9 -4
- package/dist/src/wrapper/ContainerPlugin.js +12 -11
- package/dist/src/wrapper/ContainerPlugin.js.map +1 -1
- package/dist/src/wrapper/ContainerReferencePlugin.d.ts +9 -4
- package/dist/src/wrapper/ContainerReferencePlugin.js +12 -11
- package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -1
- package/dist/src/wrapper/FederationModulesPlugin.d.ts +18 -10
- package/dist/src/wrapper/FederationModulesPlugin.js +19 -19
- package/dist/src/wrapper/FederationModulesPlugin.js.map +1 -1
- package/dist/src/wrapper/FederationRuntimePlugin.d.ts +11 -6
- package/dist/src/wrapper/FederationRuntimePlugin.js +18 -17
- package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -1
- package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +8 -3
- package/dist/src/wrapper/HoistContainerReferencesPlugin.js +12 -11
- package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -1
- package/dist/src/wrapper/ModuleFederationPlugin.d.ts +12 -7
- package/dist/src/wrapper/ModuleFederationPlugin.js +73 -99
- package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -1
- package/dist/src/wrapper/ProvideSharedPlugin.d.ts +10 -4
- package/dist/src/wrapper/ProvideSharedPlugin.js +12 -11
- package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -1
- package/dist/src/wrapper/SharePlugin.d.ts +10 -4
- package/dist/src/wrapper/SharePlugin.js +12 -11
- package/dist/src/wrapper/SharePlugin.js.map +1 -1
- package/dist/src/wrapper/TreeShakingSharedPlugin.d.ts +9 -4
- package/dist/src/wrapper/TreeShakingSharedPlugin.js +12 -11
- package/dist/src/wrapper/TreeShakingSharedPlugin.js.map +1 -1
- package/package.json +21 -14
- package/dist/package.json +0 -110
- package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +0 -57
- package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +0 -33
- package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +0 -4
- package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +0 -28
- package/dist/src/declarations/plugins/container/Template.d.ts +0 -198
- package/dist/src/declarations/plugins/container/WebpackError.d.ts +0 -33
- package/dist/src/declarations/plugins/sharing/ConsumeSharedModule.d.ts +0 -86
- package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +0 -100
- package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +0 -102
- package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +0 -116
- package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.d.ts +0 -20
- package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js +0 -219
- package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js.map +0 -1
- package/dist/src/prefetch.js.map +0 -1
- package/dist/src/rspack.js.map +0 -1
- package/dist/src/runtime.js.map +0 -1
- package/dist/src/types/runtime.d.ts +0 -10
- package/dist/src/types/runtime.js +0 -3
- package/dist/src/types/runtime.js.map +0 -1
- package/dist/src/webpack.js.map +0 -1
|
@@ -1,185 +1,148 @@
|
|
|
1
|
-
/*
|
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
-
Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy
|
|
4
|
-
*/
|
|
5
1
|
'use strict';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.js');
|
|
5
|
+
const require_lib_container_runtime_FederationModulesPlugin = require('./runtime/FederationModulesPlugin.js');
|
|
6
|
+
const require_utils = require('../../utils.js');
|
|
7
|
+
const require_lib_container_runtime_FederationRuntimePlugin = require('./runtime/FederationRuntimePlugin.js');
|
|
8
|
+
const require_lib_container_ContainerPlugin = require('./ContainerPlugin.js');
|
|
9
|
+
const require_lib_container_ContainerReferencePlugin = require('./ContainerReferencePlugin.js');
|
|
10
|
+
const require_lib_sharing_SharePlugin = require('../sharing/SharePlugin.js');
|
|
11
|
+
const require_lib_startup_MfStartupChunkDependenciesPlugin = require('../startup/MfStartupChunkDependenciesPlugin.js');
|
|
12
|
+
const require_lib_sharing_tree_shaking_TreeShakingSharedPlugin = require('../sharing/tree-shaking/TreeShakingSharedPlugin.js');
|
|
13
|
+
const require_schemas_container_ModuleFederationPlugin_check = require('../../schemas/container/ModuleFederationPlugin.check.js');
|
|
14
|
+
const require_schemas_container_ModuleFederationPlugin = require('../../schemas/container/ModuleFederationPlugin.js');
|
|
15
|
+
let _module_federation_sdk = require("@module-federation/sdk");
|
|
16
|
+
let node_path = require("node:path");
|
|
17
|
+
node_path = require_runtime.__toESM(node_path);
|
|
18
|
+
let node_fs = require("node:fs");
|
|
19
|
+
node_fs = require_runtime.__toESM(node_fs);
|
|
20
|
+
let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
|
|
21
|
+
let _module_federation_data_prefetch_cli = require("@module-federation/data-prefetch/cli");
|
|
22
|
+
let _module_federation_dts_plugin = require("@module-federation/dts-plugin");
|
|
23
|
+
let _module_federation_managers = require("@module-federation/managers");
|
|
24
|
+
let _module_federation_manifest = require("@module-federation/manifest");
|
|
25
|
+
let _module_federation_rspack_remote_entry_plugin = require("@module-federation/rspack/remote-entry-plugin");
|
|
26
|
+
|
|
27
|
+
//#region src/lib/container/ModuleFederationPlugin.ts
|
|
28
|
+
require_lib_container_runtime_FederationModulesPlugin.init_FederationModulesPlugin();
|
|
29
|
+
const isValidExternalsType = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/schemas/plugins/container/ExternalsType.check.js"));
|
|
30
|
+
const { ExternalsPlugin } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack"));
|
|
31
|
+
const validate = require_utils.createSchemaValidation((require_schemas_container_ModuleFederationPlugin_check.init_ModuleFederationPlugin_check(), require_runtime.__toCommonJS(require_schemas_container_ModuleFederationPlugin_check.ModuleFederationPlugin_check_exports)).validate, () => (require_schemas_container_ModuleFederationPlugin.init_ModuleFederationPlugin(), require_runtime.__toCommonJS(require_schemas_container_ModuleFederationPlugin.ModuleFederationPlugin_exports)).default, {
|
|
32
|
+
name: "Module Federation Plugin",
|
|
33
|
+
baseDataPath: "options"
|
|
32
34
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
definePluginOptions['FEDERATION_BUILD_IDENTIFIER'] = JSON.stringify((0, sdk_1.composeKeyWithSeparator)(name, managers_1.utils.getBuildVersion()));
|
|
47
|
-
}
|
|
48
|
-
const disableSnapshot = experiments?.optimization?.disableSnapshot ?? false;
|
|
49
|
-
definePluginOptions['FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN'] =
|
|
50
|
-
disableSnapshot;
|
|
51
|
-
// Determine ENV_TARGET: only if manually specified in experiments.optimization.target
|
|
52
|
-
if (experiments?.optimization &&
|
|
53
|
-
typeof experiments.optimization === 'object' &&
|
|
54
|
-
experiments.optimization !== null &&
|
|
55
|
-
'target' in experiments.optimization) {
|
|
56
|
-
const manualTarget = experiments.optimization.target;
|
|
57
|
-
// Ensure the target is one of the expected values before setting
|
|
58
|
-
if (manualTarget === 'web' || manualTarget === 'node') {
|
|
59
|
-
definePluginOptions['ENV_TARGET'] = JSON.stringify(manualTarget);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
// No inference for ENV_TARGET. If not manually set and valid, it's not defined.
|
|
63
|
-
new compiler.webpack.DefinePlugin(definePluginOptions).apply(compiler);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Apply the plugin
|
|
67
|
-
* @param {Compiler} compiler the compiler instance
|
|
68
|
-
* @returns {void}
|
|
69
|
-
*/
|
|
70
|
-
apply(compiler) {
|
|
71
|
-
(0, sdk_1.bindLoggerToCompiler)(sdk_1.infrastructureLogger, compiler, 'EnhancedModuleFederationPlugin');
|
|
72
|
-
const { _options: options } = this;
|
|
73
|
-
const { name, experiments, dts, remotes, shared, shareScope } = options;
|
|
74
|
-
if (!name) {
|
|
75
|
-
// TODO: remove the comment
|
|
76
|
-
throw new Error('ModuleFederationPlugin name is required');
|
|
77
|
-
}
|
|
78
|
-
// must before ModuleFederationPlugin
|
|
79
|
-
new remote_entry_plugin_1.RemoteEntryPlugin(options).apply(compiler);
|
|
80
|
-
if (experiments?.provideExternalRuntime) {
|
|
81
|
-
if (options.exposes) {
|
|
82
|
-
throw new Error('You can only set provideExternalRuntime: true in pure consumer which not expose modules.');
|
|
83
|
-
}
|
|
84
|
-
const runtimePlugins = options.runtimePlugins || [];
|
|
85
|
-
options.runtimePlugins = runtimePlugins.concat(require.resolve('@module-federation/inject-external-runtime-core-plugin'));
|
|
86
|
-
}
|
|
87
|
-
if (experiments?.externalRuntime === true) {
|
|
88
|
-
const Externals = compiler.webpack.ExternalsPlugin || ExternalsPlugin;
|
|
89
|
-
new Externals(compiler.options.externalsType || 'global', {
|
|
90
|
-
'@module-federation/runtime-core': '_FEDERATION_RUNTIME_CORE',
|
|
91
|
-
}).apply(compiler);
|
|
92
|
-
}
|
|
93
|
-
// federation hooks
|
|
94
|
-
new FederationModulesPlugin_1.default().apply(compiler);
|
|
95
|
-
if (experiments?.asyncStartup) {
|
|
96
|
-
new MfStartupChunkDependenciesPlugin_1.default({
|
|
97
|
-
asyncChunkLoading: true,
|
|
98
|
-
}).apply(compiler);
|
|
99
|
-
}
|
|
100
|
-
if (dts !== false) {
|
|
101
|
-
const dtsPlugin = new dts_plugin_1.DtsPlugin(options);
|
|
102
|
-
dtsPlugin.apply(compiler);
|
|
103
|
-
dtsPlugin.addRuntimePlugins();
|
|
104
|
-
}
|
|
105
|
-
// TODO: REMOVE in next major version
|
|
106
|
-
if (options.dataPrefetch) {
|
|
107
|
-
new cli_1.PrefetchPlugin(options).apply(compiler);
|
|
108
|
-
}
|
|
109
|
-
new FederationRuntimePlugin_1.default(options).apply(compiler);
|
|
110
|
-
const library = options.library || { type: 'var', name: name };
|
|
111
|
-
const remoteType = options.remoteType ||
|
|
112
|
-
(options.library && isValidExternalsType(options.library.type)
|
|
113
|
-
? options.library.type
|
|
114
|
-
: 'script');
|
|
115
|
-
const useContainerPlugin = options.exposes &&
|
|
116
|
-
(Array.isArray(options.exposes)
|
|
117
|
-
? options.exposes.length > 0
|
|
118
|
-
: Object.keys(options.exposes).length > 0);
|
|
119
|
-
let disableManifest = options.manifest === false;
|
|
120
|
-
if (useContainerPlugin) {
|
|
121
|
-
ContainerPlugin_1.default.patchChunkSplit(compiler, name);
|
|
122
|
-
}
|
|
123
|
-
this._patchBundlerConfig(compiler);
|
|
124
|
-
if (!disableManifest && useContainerPlugin) {
|
|
125
|
-
try {
|
|
126
|
-
const containerManager = new managers_1.ContainerManager();
|
|
127
|
-
containerManager.init(options);
|
|
128
|
-
options.exposes = containerManager.containerPluginExposesOptions;
|
|
129
|
-
}
|
|
130
|
-
catch (err) {
|
|
131
|
-
if (err instanceof Error) {
|
|
132
|
-
err.message = `[ ModuleFederationPlugin ]: Manifest will not generate, because: ${err.message}`;
|
|
133
|
-
}
|
|
134
|
-
sdk_1.infrastructureLogger.warn(err);
|
|
135
|
-
disableManifest = true;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
if (library &&
|
|
139
|
-
!compiler.options.output.enabledLibraryTypes?.includes(library.type)) {
|
|
140
|
-
compiler.options.output.enabledLibraryTypes?.push(library.type);
|
|
141
|
-
}
|
|
142
|
-
compiler.hooks.afterPlugins.tap('ModuleFederationPlugin', () => {
|
|
143
|
-
if (useContainerPlugin) {
|
|
144
|
-
new ContainerPlugin_1.default({
|
|
145
|
-
name,
|
|
146
|
-
library,
|
|
147
|
-
filename: options.filename,
|
|
148
|
-
runtime: options.runtime,
|
|
149
|
-
shareScope: options.shareScope,
|
|
150
|
-
exposes: options.exposes,
|
|
151
|
-
runtimePlugins: options.runtimePlugins,
|
|
152
|
-
}).apply(compiler);
|
|
153
|
-
}
|
|
154
|
-
if (remotes &&
|
|
155
|
-
(Array.isArray(remotes)
|
|
156
|
-
? remotes.length > 0
|
|
157
|
-
: Object.keys(remotes).length > 0)) {
|
|
158
|
-
new ContainerReferencePlugin_1.default({
|
|
159
|
-
remoteType,
|
|
160
|
-
shareScope,
|
|
161
|
-
remotes,
|
|
162
|
-
}).apply(compiler);
|
|
163
|
-
}
|
|
164
|
-
if (shared) {
|
|
165
|
-
new TreeShakingSharedPlugin_1.default({
|
|
166
|
-
mfConfig: options,
|
|
167
|
-
}).apply(compiler);
|
|
168
|
-
new SharePlugin_1.default({
|
|
169
|
-
shared,
|
|
170
|
-
shareScope,
|
|
171
|
-
}).apply(compiler);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
if (!disableManifest) {
|
|
175
|
-
const pkg = require('../../../../package.json');
|
|
176
|
-
this._statsPlugin = new manifest_1.StatsPlugin(options, {
|
|
177
|
-
pluginVersion: pkg.version,
|
|
178
|
-
bundler: 'webpack',
|
|
179
|
-
});
|
|
180
|
-
this._statsPlugin.apply(compiler);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
35
|
+
function getEnhancedPackageVersion() {
|
|
36
|
+
let currentDir = __dirname;
|
|
37
|
+
while (true) {
|
|
38
|
+
const packageJsonPath = node_path.default.join(currentDir, "package.json");
|
|
39
|
+
if (node_fs.default.existsSync(packageJsonPath)) {
|
|
40
|
+
const pkg = JSON.parse(node_fs.default.readFileSync(packageJsonPath, "utf-8"));
|
|
41
|
+
if (pkg.name === "@module-federation/enhanced" && pkg.version) return pkg.version;
|
|
42
|
+
}
|
|
43
|
+
const parentDir = node_path.default.dirname(currentDir);
|
|
44
|
+
if (parentDir === currentDir) break;
|
|
45
|
+
currentDir = parentDir;
|
|
46
|
+
}
|
|
47
|
+
throw new Error("Unable to resolve @module-federation/enhanced package.json");
|
|
183
48
|
}
|
|
49
|
+
var ModuleFederationPlugin = class {
|
|
50
|
+
/**
|
|
51
|
+
* @param {moduleFederationPlugin.ModuleFederationPluginOptions} options options
|
|
52
|
+
*/
|
|
53
|
+
constructor(options) {
|
|
54
|
+
validate(options);
|
|
55
|
+
this._options = options;
|
|
56
|
+
}
|
|
57
|
+
_patchBundlerConfig(compiler) {
|
|
58
|
+
const { name, experiments } = this._options;
|
|
59
|
+
const definePluginOptions = {};
|
|
60
|
+
const MFPluginNum = compiler.options.plugins.filter((p) => !!p && p.name === "ModuleFederationPlugin").length;
|
|
61
|
+
if (name && MFPluginNum < 2) definePluginOptions["FEDERATION_BUILD_IDENTIFIER"] = JSON.stringify((0, _module_federation_sdk.composeKeyWithSeparator)(name, _module_federation_managers.utils.getBuildVersion()));
|
|
62
|
+
definePluginOptions["FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN"] = experiments?.optimization?.disableSnapshot ?? false;
|
|
63
|
+
if (experiments?.optimization && typeof experiments.optimization === "object" && experiments.optimization !== null && "target" in experiments.optimization) {
|
|
64
|
+
const manualTarget = experiments.optimization.target;
|
|
65
|
+
if (manualTarget === "web" || manualTarget === "node") definePluginOptions["ENV_TARGET"] = JSON.stringify(manualTarget);
|
|
66
|
+
}
|
|
67
|
+
new compiler.webpack.DefinePlugin(definePluginOptions).apply(compiler);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Apply the plugin
|
|
71
|
+
* @param {Compiler} compiler the compiler instance
|
|
72
|
+
* @returns {void}
|
|
73
|
+
*/
|
|
74
|
+
apply(compiler) {
|
|
75
|
+
(0, _module_federation_sdk.bindLoggerToCompiler)(_module_federation_sdk.infrastructureLogger, compiler, "EnhancedModuleFederationPlugin");
|
|
76
|
+
const { _options: options } = this;
|
|
77
|
+
const { name, experiments, dts, remotes, shared, shareScope } = options;
|
|
78
|
+
if (!name) throw new Error("ModuleFederationPlugin name is required");
|
|
79
|
+
new _module_federation_rspack_remote_entry_plugin.RemoteEntryPlugin(options).apply(compiler);
|
|
80
|
+
const useContainerPlugin = options.exposes && (Array.isArray(options.exposes) ? options.exposes.length > 0 : Object.keys(options.exposes).length > 0);
|
|
81
|
+
if (experiments?.provideExternalRuntime) {
|
|
82
|
+
if (useContainerPlugin) throw new Error("You can only set provideExternalRuntime: true in pure consumer which not expose modules.");
|
|
83
|
+
options.runtimePlugins = (options.runtimePlugins || []).concat(require.resolve("@module-federation/inject-external-runtime-core-plugin"));
|
|
84
|
+
}
|
|
85
|
+
if (experiments?.externalRuntime === true) new (compiler.webpack.ExternalsPlugin || ExternalsPlugin)(compiler.options.externalsType || "global", { "@module-federation/runtime-core": "_FEDERATION_RUNTIME_CORE" }).apply(compiler);
|
|
86
|
+
new require_lib_container_runtime_FederationModulesPlugin.default().apply(compiler);
|
|
87
|
+
if (experiments?.asyncStartup) new require_lib_startup_MfStartupChunkDependenciesPlugin.default({ asyncChunkLoading: true }).apply(compiler);
|
|
88
|
+
if (dts !== false) {
|
|
89
|
+
const dtsPlugin = new _module_federation_dts_plugin.DtsPlugin(options);
|
|
90
|
+
dtsPlugin.apply(compiler);
|
|
91
|
+
dtsPlugin.addRuntimePlugins();
|
|
92
|
+
}
|
|
93
|
+
if (options.dataPrefetch) new _module_federation_data_prefetch_cli.PrefetchPlugin(options).apply(compiler);
|
|
94
|
+
new require_lib_container_runtime_FederationRuntimePlugin.default(options).apply(compiler);
|
|
95
|
+
const library = options.library || {
|
|
96
|
+
type: "var",
|
|
97
|
+
name
|
|
98
|
+
};
|
|
99
|
+
const containerRemoteType = options.remoteType || (options.library && isValidExternalsType(options.library.type) ? options.library.type : "script");
|
|
100
|
+
let disableManifest = options.manifest === false;
|
|
101
|
+
if (useContainerPlugin) require_lib_container_ContainerPlugin.default.patchChunkSplit(compiler, name);
|
|
102
|
+
this._patchBundlerConfig(compiler);
|
|
103
|
+
if (!disableManifest && useContainerPlugin) try {
|
|
104
|
+
const containerManager = new _module_federation_managers.ContainerManager();
|
|
105
|
+
containerManager.init(options);
|
|
106
|
+
options.exposes = containerManager.containerPluginExposesOptions;
|
|
107
|
+
} catch (err) {
|
|
108
|
+
if (err instanceof Error) err.message = `[ ModuleFederationPlugin ]: Manifest will not generate, because: ${err.message}`;
|
|
109
|
+
_module_federation_sdk.infrastructureLogger.warn(err);
|
|
110
|
+
disableManifest = true;
|
|
111
|
+
}
|
|
112
|
+
if (library && !compiler.options.output.enabledLibraryTypes?.includes(library.type)) compiler.options.output.enabledLibraryTypes?.push(library.type);
|
|
113
|
+
compiler.hooks.afterPlugins.tap("ModuleFederationPlugin", () => {
|
|
114
|
+
if (useContainerPlugin) new require_lib_container_ContainerPlugin.default({
|
|
115
|
+
name,
|
|
116
|
+
library,
|
|
117
|
+
filename: options.filename,
|
|
118
|
+
runtime: options.runtime,
|
|
119
|
+
shareScope: options.shareScope,
|
|
120
|
+
exposes: options.exposes,
|
|
121
|
+
runtimePlugins: options.runtimePlugins
|
|
122
|
+
}).apply(compiler);
|
|
123
|
+
if (remotes && (Array.isArray(remotes) ? remotes.length > 0 : Object.keys(remotes).length > 0)) new require_lib_container_ContainerReferencePlugin.default({
|
|
124
|
+
remoteType: containerRemoteType,
|
|
125
|
+
shareScope,
|
|
126
|
+
remotes
|
|
127
|
+
}).apply(compiler);
|
|
128
|
+
if (shared) {
|
|
129
|
+
new require_lib_sharing_tree_shaking_TreeShakingSharedPlugin.default({ mfConfig: options }).apply(compiler);
|
|
130
|
+
new require_lib_sharing_SharePlugin.default({
|
|
131
|
+
shared,
|
|
132
|
+
shareScope
|
|
133
|
+
}).apply(compiler);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
if (!disableManifest) {
|
|
137
|
+
this._statsPlugin = new _module_federation_manifest.StatsPlugin(options, {
|
|
138
|
+
pluginVersion: getEnhancedPackageVersion(),
|
|
139
|
+
bundler: "webpack"
|
|
140
|
+
});
|
|
141
|
+
this._statsPlugin.apply(compiler);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
//#endregion
|
|
184
147
|
exports.default = ModuleFederationPlugin;
|
|
185
148
|
//# sourceMappingURL=ModuleFederationPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleFederationPlugin.js","sourceRoot":"","sources":["../../../../src/lib/container/ModuleFederationPlugin.ts"],"names":[],"mappings":"AAAA;;;EAGE;AAEF,YAAY,CAAC;;;;;AACb,8DAA0D;AAC1D,0DAAsE;AACtE,0DAA0D;AAC1D,gDAKgC;AAChC,8DAAsE;AACtE,0FAAqF;AAErF,yEAAiD;AACjD,wEAAgD;AAChD,0FAAkE;AAClE,gGAAwE;AACxE,uFAAkF;AAElF,mHAAyF;AACzF,gGAAwE;AACxE,uCAAqD;AACrD,8GAAsF;AAEtF,MAAM,oBAAoB,GAAG,OAAO,CAClC,IAAA,6CAAoB,EAClB,0DAA0D,CAC3D,CAC2E,CA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GAAG,IAAI,sBAAW,CAAC,OAAO,EAAE;gBAC3C,aAAa,EAAE,GAAG,CAAC,OAAO;gBAC1B,OAAO,EAAE,SAAS;aACnB,CAAC,CAAC;YACH,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;CACF;AAED,kBAAe,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"ModuleFederationPlugin.js","names":["createSchemaValidation","path","fs","utils","infrastructureLogger","RemoteEntryPlugin","FederationModulesPlugin","StartupChunkDependenciesPlugin","DtsPlugin","PrefetchPlugin","FederationRuntimePlugin","ContainerManager","ContainerPlugin","ContainerReferencePlugin","TreeShakingSharedPlugin","SharePlugin","StatsPlugin"],"sources":["../../../../src/lib/container/ModuleFederationPlugin.ts"],"sourcesContent":["/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy\n*/\n\n'use strict';\nimport { DtsPlugin } from '@module-federation/dts-plugin';\nimport { ContainerManager, utils } from '@module-federation/managers';\nimport { StatsPlugin } from '@module-federation/manifest';\nimport {\n bindLoggerToCompiler,\n composeKeyWithSeparator,\n type moduleFederationPlugin,\n infrastructureLogger,\n} from '@module-federation/sdk';\nimport { PrefetchPlugin } from '@module-federation/data-prefetch/cli';\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport type { Compiler, WebpackPluginInstance } from 'webpack';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport SharePlugin from '../sharing/SharePlugin';\nimport ContainerPlugin from './ContainerPlugin';\nimport ContainerReferencePlugin from './ContainerReferencePlugin';\nimport FederationRuntimePlugin from './runtime/FederationRuntimePlugin';\nimport { RemoteEntryPlugin } from '@module-federation/rspack/remote-entry-plugin';\nimport StartupChunkDependenciesPlugin from '../startup/MfStartupChunkDependenciesPlugin';\nimport FederationModulesPlugin from './runtime/FederationModulesPlugin';\nimport { createSchemaValidation } from '../../utils';\nimport TreeShakingSharedPlugin from '../sharing/tree-shaking/TreeShakingSharedPlugin';\n\nconst isValidExternalsType = require(\n normalizeWebpackPath(\n 'webpack/schemas/plugins/container/ExternalsType.check.js',\n ),\n) as typeof import('webpack/schemas/plugins/container/ExternalsType.check.js');\n\nconst { ExternalsPlugin } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\n\nconst validate = createSchemaValidation(\n //eslint-disable-next-line\n require('../../schemas/container/ModuleFederationPlugin.check.js').validate,\n () => require('../../schemas/container/ModuleFederationPlugin').default,\n {\n name: 'Module Federation Plugin',\n baseDataPath: 'options',\n },\n);\n\nfunction getEnhancedPackageVersion(): string {\n let currentDir = __dirname;\n\n while (true) {\n const packageJsonPath = path.join(currentDir, 'package.json');\n\n if (fs.existsSync(packageJsonPath)) {\n const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')) as {\n name?: string;\n version?: string;\n };\n\n if (pkg.name === '@module-federation/enhanced' && pkg.version) {\n return pkg.version;\n }\n }\n\n const parentDir = path.dirname(currentDir);\n if (parentDir === currentDir) {\n break;\n }\n currentDir = parentDir;\n }\n\n throw new Error('Unable to resolve @module-federation/enhanced package.json');\n}\n\nclass ModuleFederationPlugin implements WebpackPluginInstance {\n private _options: moduleFederationPlugin.ModuleFederationPluginOptions;\n private _statsPlugin?: StatsPlugin;\n /**\n * @param {moduleFederationPlugin.ModuleFederationPluginOptions} options options\n */\n constructor(options: moduleFederationPlugin.ModuleFederationPluginOptions) {\n validate(options);\n this._options = options;\n }\n\n private _patchBundlerConfig(compiler: Compiler): void {\n const { name, experiments } = this._options;\n const definePluginOptions: Record<string, string | boolean> = {};\n\n const MFPluginNum = compiler.options.plugins.filter(\n (p): p is WebpackPluginInstance =>\n !!p && (p as any).name === 'ModuleFederationPlugin',\n ).length;\n\n if (name && MFPluginNum < 2) {\n definePluginOptions['FEDERATION_BUILD_IDENTIFIER'] = JSON.stringify(\n composeKeyWithSeparator(name, utils.getBuildVersion()),\n );\n }\n\n const disableSnapshot = experiments?.optimization?.disableSnapshot ?? false;\n definePluginOptions['FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN'] =\n disableSnapshot;\n\n // Determine ENV_TARGET: only if manually specified in experiments.optimization.target\n if (\n experiments?.optimization &&\n typeof experiments.optimization === 'object' &&\n experiments.optimization !== null &&\n 'target' in experiments.optimization\n ) {\n const manualTarget = experiments.optimization.target as\n | 'web'\n | 'node'\n | undefined;\n // Ensure the target is one of the expected values before setting\n if (manualTarget === 'web' || manualTarget === 'node') {\n definePluginOptions['ENV_TARGET'] = JSON.stringify(manualTarget);\n }\n }\n // No inference for ENV_TARGET. If not manually set and valid, it's not defined.\n\n new compiler.webpack.DefinePlugin(definePluginOptions).apply(compiler);\n }\n\n /**\n * Apply the plugin\n * @param {Compiler} compiler the compiler instance\n * @returns {void}\n */\n apply(compiler: Compiler): void {\n bindLoggerToCompiler(\n infrastructureLogger,\n compiler,\n 'EnhancedModuleFederationPlugin',\n );\n const { _options: options } = this;\n const { name, experiments, dts, remotes, shared, shareScope } = options;\n if (!name) {\n // TODO: remove the comment\n throw new Error('ModuleFederationPlugin name is required');\n }\n // must before ModuleFederationPlugin\n (new RemoteEntryPlugin(options) as unknown as WebpackPluginInstance).apply(\n compiler,\n );\n const useContainerPlugin =\n options.exposes &&\n (Array.isArray(options.exposes)\n ? options.exposes.length > 0\n : Object.keys(options.exposes).length > 0);\n\n if (experiments?.provideExternalRuntime) {\n if (useContainerPlugin) {\n throw new Error(\n 'You can only set provideExternalRuntime: true in pure consumer which not expose modules.',\n );\n }\n const runtimePlugins = options.runtimePlugins || [];\n options.runtimePlugins = runtimePlugins.concat(\n require.resolve('@module-federation/inject-external-runtime-core-plugin'),\n );\n }\n\n if (experiments?.externalRuntime === true) {\n const Externals = compiler.webpack.ExternalsPlugin || ExternalsPlugin;\n new Externals(compiler.options.externalsType || 'global', {\n '@module-federation/runtime-core': '_FEDERATION_RUNTIME_CORE',\n }).apply(compiler);\n }\n\n // federation hooks\n new FederationModulesPlugin().apply(compiler);\n\n if (experiments?.asyncStartup) {\n new StartupChunkDependenciesPlugin({\n asyncChunkLoading: true,\n }).apply(compiler);\n }\n\n if (dts !== false) {\n const dtsPlugin = new DtsPlugin(options);\n dtsPlugin.apply(compiler);\n dtsPlugin.addRuntimePlugins();\n }\n // TODO: REMOVE in next major version\n if (options.dataPrefetch) {\n new PrefetchPlugin(options).apply(compiler);\n }\n\n new FederationRuntimePlugin(options).apply(compiler);\n\n const library = options.library || { type: 'var', name: name };\n const remoteType =\n options.remoteType ||\n (options.library && isValidExternalsType(options.library.type)\n ? (options.library.type as moduleFederationPlugin.ExternalsType)\n : ('script' as moduleFederationPlugin.ExternalsType));\n const containerRemoteType =\n remoteType as moduleFederationPlugin.ExternalsType;\n\n let disableManifest = options.manifest === false;\n if (useContainerPlugin) {\n ContainerPlugin.patchChunkSplit(compiler, name);\n }\n this._patchBundlerConfig(compiler);\n if (!disableManifest && useContainerPlugin) {\n try {\n const containerManager = new ContainerManager();\n containerManager.init(options);\n options.exposes = containerManager.containerPluginExposesOptions;\n } catch (err) {\n if (err instanceof Error) {\n err.message = `[ ModuleFederationPlugin ]: Manifest will not generate, because: ${err.message}`;\n }\n infrastructureLogger.warn(err);\n disableManifest = true;\n }\n }\n\n if (\n library &&\n !compiler.options.output.enabledLibraryTypes?.includes(library.type)\n ) {\n compiler.options.output.enabledLibraryTypes?.push(library.type);\n }\n\n compiler.hooks.afterPlugins.tap('ModuleFederationPlugin', () => {\n if (useContainerPlugin) {\n new ContainerPlugin({\n name,\n library,\n filename: options.filename,\n runtime: options.runtime,\n shareScope: options.shareScope,\n exposes: options.exposes!,\n runtimePlugins: options.runtimePlugins,\n }).apply(compiler);\n }\n if (\n remotes &&\n (Array.isArray(remotes)\n ? remotes.length > 0\n : Object.keys(remotes).length > 0)\n ) {\n new ContainerReferencePlugin({\n remoteType: containerRemoteType,\n shareScope,\n remotes,\n }).apply(compiler);\n }\n if (shared) {\n new TreeShakingSharedPlugin({\n mfConfig: options,\n }).apply(compiler);\n new SharePlugin({\n shared,\n shareScope,\n }).apply(compiler);\n }\n });\n\n if (!disableManifest) {\n this._statsPlugin = new StatsPlugin(options, {\n pluginVersion: getEnhancedPackageVersion(),\n bundler: 'webpack',\n });\n this._statsPlugin.apply(compiler);\n }\n }\n}\n\nexport default ModuleFederationPlugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;oFA0BwE;AAIxE,MAAM,uBAAuB,gFAEzB,2DACD,CACF;AAED,MAAM,EAAE,oBAAoB,gFACL,UAAU,CAChC;AAED,MAAM,WAAWA,6PAEoD,gNACH,SAChE;CACE,MAAM;CACN,cAAc;CACf,CACF;AAED,SAAS,4BAAoC;CAC3C,IAAI,aAAa;AAEjB,QAAO,MAAM;EACX,MAAM,kBAAkBC,kBAAK,KAAK,YAAY,eAAe;AAE7D,MAAIC,gBAAG,WAAW,gBAAgB,EAAE;GAClC,MAAM,MAAM,KAAK,MAAMA,gBAAG,aAAa,iBAAiB,QAAQ,CAAC;AAKjE,OAAI,IAAI,SAAS,iCAAiC,IAAI,QACpD,QAAO,IAAI;;EAIf,MAAM,YAAYD,kBAAK,QAAQ,WAAW;AAC1C,MAAI,cAAc,WAChB;AAEF,eAAa;;AAGf,OAAM,IAAI,MAAM,6DAA6D;;AAG/E,IAAM,yBAAN,MAA8D;;;;CAM5D,YAAY,SAA+D;AACzE,WAAS,QAAQ;AACjB,OAAK,WAAW;;CAGlB,AAAQ,oBAAoB,UAA0B;EACpD,MAAM,EAAE,MAAM,gBAAgB,KAAK;EACnC,MAAM,sBAAwD,EAAE;EAEhE,MAAM,cAAc,SAAS,QAAQ,QAAQ,QAC1C,MACC,CAAC,CAAC,KAAM,EAAU,SAAS,yBAC9B,CAAC;AAEF,MAAI,QAAQ,cAAc,EACxB,qBAAoB,iCAAiC,KAAK,8DAChC,MAAME,kCAAM,iBAAiB,CAAC,CACvD;AAIH,sBAAoB,4CADI,aAAa,cAAc,mB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C,iBAAiB;AACpB,QAAK,eAAe,IAAIC,wCAAY,SAAS;IAC3C,eAAe,2BAA2B;IAC1C,SAAS;IACV,CAAC;AACF,QAAK,aAAa,MAAM,SAAS"}
|
|
@@ -1,75 +1,80 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
1
|
+
import * as webpack$1 from "webpack";
|
|
2
|
+
import { Compilation, WebpackOptionsNormalized } from "webpack";
|
|
3
|
+
import { CodeGenerationContext, CodeGenerationResult, LibIdentOptions, NeedBuildContext, WebpackError } from "webpack/lib/Module";
|
|
4
|
+
import { ResolverWithOptions as ResolverWithOptions$1 } from "webpack/lib/ResolverFactory";
|
|
5
|
+
import { InputFileSystem as InputFileSystem$1 } from "webpack/lib/FileSystemInfo";
|
|
6
|
+
import { RequestShortener as RequestShortener$1 } from "webpack/lib/RuntimeModule";
|
|
7
|
+
import { ObjectDeserializerContext as ObjectDeserializerContext$1 } from "webpack/lib/serialization/ObjectMiddleware";
|
|
8
|
+
|
|
9
|
+
//#region src/lib/container/RemoteModule.d.ts
|
|
10
|
+
declare const Module$1: typeof webpack$1.Module;
|
|
11
|
+
declare class RemoteModule extends Module$1 {
|
|
12
|
+
private _identifier;
|
|
13
|
+
request: string;
|
|
14
|
+
externalRequests: string[];
|
|
15
|
+
internalRequest: string;
|
|
16
|
+
shareScope: string | string[];
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} request request string
|
|
19
|
+
* @param {string[]} externalRequests list of external requests to containers
|
|
20
|
+
* @param {string} internalRequest name of exposed module in container
|
|
21
|
+
* @param {string|string[]} shareScope scope in which modules are shared
|
|
22
|
+
*/
|
|
23
|
+
constructor(request: string, externalRequests: string[], internalRequest: string, shareScope: string | string[]);
|
|
24
|
+
/**
|
|
25
|
+
* @returns {string} a unique identifier of the module
|
|
26
|
+
*/
|
|
27
|
+
identifier(): string;
|
|
28
|
+
/**
|
|
29
|
+
* @param {RequestShortener} requestShortener the request shortener
|
|
30
|
+
* @returns {string} a user readable identifier of the module
|
|
31
|
+
*/
|
|
32
|
+
readableIdentifier(requestShortener: RequestShortener$1): string;
|
|
33
|
+
/**
|
|
34
|
+
* @param {LibIdentOptions} options options
|
|
35
|
+
* @returns {string | null} an identifier for library inclusion
|
|
36
|
+
*/
|
|
37
|
+
libIdent(options: LibIdentOptions): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* @param {NeedBuildContext} context context info
|
|
40
|
+
* @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild
|
|
41
|
+
* @returns {void}
|
|
42
|
+
*/
|
|
43
|
+
needBuild(context: NeedBuildContext, callback: (err: WebpackError | null, needsRebuild?: boolean) => void): void;
|
|
44
|
+
/**
|
|
45
|
+
* @param {WebpackOptions} options webpack options
|
|
46
|
+
* @param {Compilation} compilation the compilation
|
|
47
|
+
* @param {ResolverWithOptions} resolver the resolver
|
|
48
|
+
* @param {InputFileSystem} fs the file system
|
|
49
|
+
* @param {function(WebpackError=): void} callback callback function
|
|
50
|
+
* @returns {void}
|
|
51
|
+
*/
|
|
52
|
+
build(options: WebpackOptionsNormalized, compilation: Compilation, resolver: ResolverWithOptions$1, fs: InputFileSystem$1, callback: (err?: WebpackError | undefined) => void): void;
|
|
53
|
+
/**
|
|
54
|
+
* @param {string=} type the source type for which the size should be estimated
|
|
55
|
+
* @returns {number} the estimated size of the module (must be non-zero)
|
|
56
|
+
*/
|
|
57
|
+
size(type?: string): number;
|
|
58
|
+
/**
|
|
59
|
+
* @returns {Set<string>} types available (do not mutate)
|
|
60
|
+
*/
|
|
61
|
+
getSourceTypes(): Set<string>;
|
|
62
|
+
/**
|
|
63
|
+
* @returns {string | null} absolute path which should be used for condition matching (usually the resource path)
|
|
64
|
+
*/
|
|
65
|
+
nameForCondition(): string | null;
|
|
66
|
+
/**
|
|
67
|
+
* @param {CodeGenerationContext} context context for code generation
|
|
68
|
+
* @returns {CodeGenerationResult} result
|
|
69
|
+
*/
|
|
70
|
+
codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
|
|
71
|
+
serialize(context: any): void;
|
|
72
|
+
/**
|
|
73
|
+
* @param {ObjectDeserializerContext} context context
|
|
74
|
+
* @returns {RemoteModule} deserialized module
|
|
75
|
+
*/
|
|
76
|
+
static deserialize(context: ObjectDeserializerContext$1): RemoteModule;
|
|
74
77
|
}
|
|
75
|
-
|
|
78
|
+
//#endregion
|
|
79
|
+
export { RemoteModule as default };
|
|
80
|
+
//# sourceMappingURL=RemoteModule.d.ts.map
|