@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
package/dist/README.md
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# `@module-federation/enhanced`
|
|
2
|
+
|
|
3
|
+
This package provides enhanced features for module federation.
|
|
4
|
+
|
|
5
|
+
The following items are exported:
|
|
6
|
+
|
|
7
|
+
- ModuleFederationPlugin
|
|
8
|
+
- ContainerPlugin
|
|
9
|
+
- ContainerReferencePlugin
|
|
10
|
+
- SharePlugin
|
|
11
|
+
- ConsumeSharedPlugin
|
|
12
|
+
- ProvideSharedPlugin
|
|
13
|
+
- FederationRuntimePlugin
|
|
14
|
+
- AsyncBoundaryPlugin
|
|
15
|
+
- HoistContainerReferencesPlugin
|
|
16
|
+
|
|
17
|
+
## Documentation
|
|
18
|
+
|
|
19
|
+
See [https://module-federation.io/guide/build-plugins/plugins.html](https://module-federation.io/guide/build-plugins/plugins.html) for details.
|
|
20
|
+
|
|
21
|
+
## ModuleFederationPlugin
|
|
22
|
+
|
|
23
|
+
### Configuration
|
|
24
|
+
|
|
25
|
+
### name
|
|
26
|
+
|
|
27
|
+
- Type: `string`
|
|
28
|
+
- Required: No
|
|
29
|
+
|
|
30
|
+
The name of the container.
|
|
31
|
+
|
|
32
|
+
### exposes
|
|
33
|
+
|
|
34
|
+
- Type: `Exposes`
|
|
35
|
+
- Required: No
|
|
36
|
+
- Default: `undefined`
|
|
37
|
+
|
|
38
|
+
Used to specify the modules and file entry points that are exposed via Module Federation. After configuration, the exposed modules will be extracted into a separate chunk, and if there are async chunks, they will also be extracted into a separate chunk (the specific splitting behavior depends on the chunk splitting rules).
|
|
39
|
+
|
|
40
|
+
The `Exposes` type is defined as follows:
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
type Exposes = (ExposesItem | ExposesObject)[] | ExposesObject;
|
|
44
|
+
|
|
45
|
+
type ExposesItem = string;
|
|
46
|
+
|
|
47
|
+
type ExposesItems = ExposesItem[];
|
|
48
|
+
|
|
49
|
+
interface ExposesObject {
|
|
50
|
+
[exposeKey: string]: ExposesConfig | ExposesItem | ExposesItems;
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Here, `exposeKey` is essentially the same as the [Package Entry Points](https://nodejs.org/api/packages.html#package-entry-points) specification (except that regular expression matching is not supported).
|
|
55
|
+
|
|
56
|
+
For example:
|
|
57
|
+
|
|
58
|
+
```jsx
|
|
59
|
+
module.exports = {
|
|
60
|
+
plugins: [
|
|
61
|
+
new ModuleFederationPlugin({
|
|
62
|
+
name: 'mfButton',
|
|
63
|
+
exposes: {
|
|
64
|
+
// Note: "./" is not supported
|
|
65
|
+
'.': './src/index.tsx',
|
|
66
|
+
'./add': './src/utils/add.ts',
|
|
67
|
+
'./Button': './src/components/Button.tsx',
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### remotes
|
|
75
|
+
|
|
76
|
+
> This is a consumer-specific parameter. If remotes is set, it can be considered as a consumer.
|
|
77
|
+
|
|
78
|
+
- Type: `Remotes`
|
|
79
|
+
- Required: No
|
|
80
|
+
- Default: `undefined`
|
|
81
|
+
|
|
82
|
+
This is used to specify how Module Federation consumes remote modules.
|
|
83
|
+
|
|
84
|
+
The `Remotes` type is defined as follows:
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
type Remotes = (RemotesItem | RemotesObject)[] | RemotesObject;
|
|
88
|
+
|
|
89
|
+
type RemotesItem = string;
|
|
90
|
+
type RemotesItems = RemotesItem[];
|
|
91
|
+
|
|
92
|
+
interface RemotesObject {
|
|
93
|
+
[remoteAlias: string]: RemotesConfig | RemotesItem | RemotesItems;
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Here, `remoteAlias` is the name actually used by the user and can be configured arbitrarily. For example, if `remoteAlias` is set to `demo`, the consumption method is `import xx from 'demo'`.
|
|
98
|
+
|
|
99
|
+
### shared
|
|
100
|
+
|
|
101
|
+
- Type: `Shared`
|
|
102
|
+
- Required: No
|
|
103
|
+
- Default: `undefined`
|
|
104
|
+
|
|
105
|
+
`shared` is used to share common dependencies between consumers and producers, reducing runtime download size and thus improving performance.
|
|
106
|
+
|
|
107
|
+
The `Shared` type is defined as follows:
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
type Shared = (SharedItem | SharedObject)[] | SharedObject;
|
|
111
|
+
|
|
112
|
+
type SharedItem = string;
|
|
113
|
+
|
|
114
|
+
interface SharedObject {
|
|
115
|
+
[k: string]: SharedConfig | SharedItem;
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
#### singleton
|
|
120
|
+
|
|
121
|
+
- Type: `boolean`
|
|
122
|
+
- Required: No
|
|
123
|
+
- Default: `false`
|
|
124
|
+
|
|
125
|
+
Determines whether only one version of the shared module is allowed in the shared scope (singleton mode).
|
|
126
|
+
|
|
127
|
+
- If the value is true, singleton mode is enabled; if the value is false, singleton mode is not enabled.
|
|
128
|
+
- If singleton mode is enabled, the shared dependencies of the remote application components and host application are loaded only once, and a higher version is loaded when the versions are not consistent. At this time, a warning will be given to the lower version side:
|
|
129
|
+
- If singleton mode is not enabled, if the versions of shared dependencies between the remote application and host application are not consistent, the remote application and host application load their own dependencies
|
|
130
|
+
|
|
131
|
+
#### requiredVersion
|
|
132
|
+
|
|
133
|
+
- Type: `string`
|
|
134
|
+
- Required: False
|
|
135
|
+
- Default: `require('project/package.json')[devDeps | dep]['depName']`
|
|
136
|
+
|
|
137
|
+
The required version can be a version range. The default value is the dependency version of the current application.
|
|
138
|
+
|
|
139
|
+
- When using shared dependencies, it will be judged whether the dependency version meets requiredVersion. If it does, it will be used normally. If it is less than requiredVersion, a warning will be issued in the console, and the smallest version in the current shared dependency will be used.
|
|
140
|
+
- When one side sets requiredVersion and the other side sets singleton, the dependency of requiredVersion will be loaded, and the singleton side will directly use the dependency of requiredVersion, regardless of the version.
|
|
141
|
+
|
|
142
|
+
#### eager
|
|
143
|
+
|
|
144
|
+
:::warning
|
|
145
|
+
When `eager` is set to true, the shared dependencies will be packaged into the entry file, which will cause the entry file to be too large. Please open with caution.
|
|
146
|
+
`eager: true` is rarely recommended
|
|
147
|
+
:::
|
|
148
|
+
|
|
149
|
+
- Type: `boolean`
|
|
150
|
+
- Required: False
|
|
151
|
+
- Default: `false`
|
|
152
|
+
|
|
153
|
+
Determines whether to load shared modules immediately.
|
|
154
|
+
|
|
155
|
+
Under normal circumstances, you need to open the asynchronous entry, and then load shared asynchronously on demand. If you want to use shared but don't want to enable asynchronous entry, you can set `eager` to true .
|
|
156
|
+
|
|
157
|
+
### runtimePlugins
|
|
158
|
+
|
|
159
|
+
- Type: `string[] | Array<[string, Record<string, unknown>]>`
|
|
160
|
+
- Required: False
|
|
161
|
+
- Default: `undefined`
|
|
162
|
+
|
|
163
|
+
Used to add additional plug-ins required at runtime. The value is the path of the specific plug-in. It supports absolute/relative paths and package names.
|
|
164
|
+
|
|
165
|
+
Once set, the runtime plugin is automatically injected and used at build time.
|
|
166
|
+
|
|
167
|
+
### implementation
|
|
168
|
+
|
|
169
|
+
- Type: `string`
|
|
170
|
+
- Required: False
|
|
171
|
+
- Default: `undefined`
|
|
172
|
+
|
|
173
|
+
Used to modify the actual bundler runtime version. Path with value `@module-federation/runtime-tools`.
|
|
174
|
+
|
|
175
|
+
## CLI
|
|
176
|
+
|
|
177
|
+
To view all available CLI commands, run the following command in the project directory:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
npx mf -h
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The output is shown below:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
Usage: mf <command> [options]
|
|
187
|
+
|
|
188
|
+
Options:
|
|
189
|
+
-V, --version output the version number
|
|
190
|
+
-h, --help display help for command
|
|
191
|
+
|
|
192
|
+
Commands:
|
|
193
|
+
dts [options] generate or fetch the mf types
|
|
194
|
+
help [command] display help for command
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### mf dts
|
|
198
|
+
|
|
199
|
+
The mf dts command is used to generate or fetch remote types.
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
Usage: mf dts [options]
|
|
203
|
+
|
|
204
|
+
generate or fetch the mf types
|
|
205
|
+
|
|
206
|
+
Options:
|
|
207
|
+
--root <root> specify the project root directory
|
|
208
|
+
--output <output> specify the generated dts output directory
|
|
209
|
+
--fetch <boolean> fetch types from remote, default is true (default: true)
|
|
210
|
+
--generate <boolean> generate types, default is true (default: true)
|
|
211
|
+
-c --config <config> specify the configuration file, can be a relative or absolute path
|
|
212
|
+
-h, --help display help for command
|
|
213
|
+
```
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Rstest migration plan for packages/enhanced
|
|
2
|
+
|
|
3
|
+
This document captures the work needed to migrate the enhanced package tests
|
|
4
|
+
from Jest to Rstest. It is written against the current repo state and the
|
|
5
|
+
Rstest docs listed in the references section.
|
|
6
|
+
|
|
7
|
+
## Current state
|
|
8
|
+
- Jest configs are in `packages/enhanced/jest.config.ts` and
|
|
9
|
+
`packages/enhanced/jest.embed.ts`, with Nx targets `test:jest` and
|
|
10
|
+
`test:experiments` in `packages/enhanced/project.json`.
|
|
11
|
+
- The default `enhanced:test` target runs Vitest via
|
|
12
|
+
`packages/enhanced/vitest.config.ts`.
|
|
13
|
+
- Rstest is already wired in `packages/enhanced/rstest.config.ts`, but only
|
|
14
|
+
includes `test/ConfigTestCases.*.rstest.ts` files.
|
|
15
|
+
- Many unit and compiler tests under `packages/enhanced/test/**` are Jest-only
|
|
16
|
+
(global `jest`, `jest.mock`, `jest.fn`, callback-style `done`, etc).
|
|
17
|
+
|
|
18
|
+
## Target state
|
|
19
|
+
- All enhanced package tests run under Rstest via `enhanced:rstest`.
|
|
20
|
+
- Nx target `enhanced:test` uses Rstest and no longer depends on Jest/Vitest.
|
|
21
|
+
- Jest-only helpers/configs in `packages/enhanced` are removed or unused.
|
|
22
|
+
|
|
23
|
+
## Work items
|
|
24
|
+
|
|
25
|
+
### 1) Update scripts and Nx targets
|
|
26
|
+
- Switch `packages/enhanced/project.json` `test` target to Rstest:
|
|
27
|
+
`rstest run -c packages/enhanced/rstest.config.ts` (match CLI usage).
|
|
28
|
+
- Replace or remove `test:jest` and `test:experiments` targets, or rewrite
|
|
29
|
+
them as Rstest equivalents (for example, separate includes/projects).
|
|
30
|
+
- Keep `enhanced:rstest` in the root `package.json` as the user-facing entry
|
|
31
|
+
point and ensure it uses `rstest run` (or `rstest`) consistently.
|
|
32
|
+
|
|
33
|
+
### 2) Expand `rstest.config.ts` coverage
|
|
34
|
+
- Include unit and compiler tests (not just ConfigTestCases):
|
|
35
|
+
- `test/**/*.test.ts`
|
|
36
|
+
- `test/**/*.spec.ts`
|
|
37
|
+
- `test/**/*.rstest.ts` (keep existing Rstest cases)
|
|
38
|
+
- Exclude non-Rstest variants to prevent duplicate runs:
|
|
39
|
+
- `test/**/*.vitest.ts`
|
|
40
|
+
- `test/**/*.basictest.js` (Jest-only)
|
|
41
|
+
- `test/**/*.embedruntime.js` (Jest-only)
|
|
42
|
+
- Consider Rstest `projects` to separate long-running config-case tests from
|
|
43
|
+
fast unit tests (different `testTimeout`, `include`, etc).
|
|
44
|
+
- Add `setupFiles` to reapply `test/setupTestFramework.js` logic (custom
|
|
45
|
+
matchers and debug hooks).
|
|
46
|
+
- If cleaning `packages/enhanced/test/js` is still required, move it to
|
|
47
|
+
`globalSetup` or a pretest script instead of Jest config.
|
|
48
|
+
|
|
49
|
+
### 3) Replace Jest APIs in tests
|
|
50
|
+
Map Jest-only APIs to Rstest equivalents and update imports where needed.
|
|
51
|
+
|
|
52
|
+
Core mappings:
|
|
53
|
+
- `jest.fn` -> `rs.fn` (from `@rstest/core`)
|
|
54
|
+
- `jest.spyOn` -> `rs.spyOn`
|
|
55
|
+
- `jest.mock` -> `rs.mock`
|
|
56
|
+
- `jest.doMock` -> `rs.doMock`
|
|
57
|
+
- `jest.dontMock` -> `rs.unmock` or `rs.doUnmock`
|
|
58
|
+
- `jest.resetModules` -> `rs.resetModules` (note: does not clear mocks)
|
|
59
|
+
- `jest.clearAllMocks` -> `rs.clearAllMocks`
|
|
60
|
+
- `jest.resetAllMocks` -> `rs.resetAllMocks`
|
|
61
|
+
- `jest.restoreAllMocks` -> `rs.restoreAllMocks`
|
|
62
|
+
- `jest.setTimeout` -> `rs.setConfig({ testTimeout })` or config `testTimeout`
|
|
63
|
+
- `jest.requireActual` -> `await rs.importActual(...)` or
|
|
64
|
+
`import ... with { rstest: 'importActual' }`
|
|
65
|
+
|
|
66
|
+
Known gaps to rework:
|
|
67
|
+
- `jest.isolateModules` has no direct Rstest equivalent; use
|
|
68
|
+
`rs.resetModules` + dynamic `import()` and refactor those tests.
|
|
69
|
+
|
|
70
|
+
Files to review specifically (non-exhaustive):
|
|
71
|
+
- `packages/enhanced/test/helpers/webpackMocks.ts`
|
|
72
|
+
- `packages/enhanced/test/compiler-unit/**/*.test.ts`
|
|
73
|
+
- `packages/enhanced/test/unit/**/*.test.ts`
|
|
74
|
+
- `packages/enhanced/test/ConfigTestCases.template.js`
|
|
75
|
+
- `packages/enhanced/test/ConfigTestCases.embedruntime.js`
|
|
76
|
+
- `packages/enhanced/test/ConfigTestCases.basictest.js`
|
|
77
|
+
|
|
78
|
+
### 4) Remove callback-style `done` usage
|
|
79
|
+
Rstest does not support `done` callbacks in tests. Convert to async/Promise
|
|
80
|
+
style (return a Promise or `async` function). Key files include:
|
|
81
|
+
- `packages/enhanced/test/warmup-webpack.js`
|
|
82
|
+
- `packages/enhanced/test/helpers/expectWarningFactory.js`
|
|
83
|
+
- `packages/enhanced/test/compiler-unit/container/HoistContainerReferencesPlugin.test.ts`
|
|
84
|
+
- `packages/enhanced/test/ConfigTestCases.template.js` (if still used)
|
|
85
|
+
|
|
86
|
+
Note: callback-style functions inside config-case bundles are already wrapped
|
|
87
|
+
in `packages/enhanced/test/ConfigTestCases.rstest.ts` and do not require
|
|
88
|
+
Rstest to support `done`.
|
|
89
|
+
|
|
90
|
+
### 5) TypeScript types and globals
|
|
91
|
+
- Decide between explicit imports (`import { describe, it, expect, rs }`)
|
|
92
|
+
vs `globals: true`. The current `rstest.config.ts` uses `globals: true`.
|
|
93
|
+
- If keeping globals, update `packages/enhanced/tsconfig.spec.json` to include
|
|
94
|
+
`@rstest/core/globals` and remove `jest` types.
|
|
95
|
+
- Replace `jest.Mock`, `jest.MockedFunction`, etc. with Rstest types
|
|
96
|
+
(`Mock`, `MockInstance`) from `@rstest/core`.
|
|
97
|
+
|
|
98
|
+
### 6) Remove Jest-only infra
|
|
99
|
+
- Drop or ignore `packages/enhanced/jest.config.ts`,
|
|
100
|
+
`packages/enhanced/jest.embed.ts`, and `packages/enhanced/test/patch-node-env.js`
|
|
101
|
+
once no tests rely on them.
|
|
102
|
+
- Rework `packages/enhanced/test/helpers/createLazyTestEnv.js`, which depends on
|
|
103
|
+
`JEST_STATE_SYMBOL`. Prefer avoiding this helper under Rstest or implement a
|
|
104
|
+
Rstest-native alternative if still needed.
|
|
105
|
+
|
|
106
|
+
### 7) Verify behavior and parity
|
|
107
|
+
- Run `pnpm enhanced:rstest` and check for parity with the old Jest suite.
|
|
108
|
+
- Use `rstest list --filesOnly -c packages/enhanced/rstest.config.ts` to verify
|
|
109
|
+
include/exclude patterns.
|
|
110
|
+
- Validate that custom matchers in `test/setupTestFramework.js` still work with
|
|
111
|
+
Rstest's `expect.extend`.
|
|
112
|
+
|
|
113
|
+
## Suggested file-level checklist
|
|
114
|
+
- `packages/enhanced/project.json`: update `test` target and pre-release steps.
|
|
115
|
+
- `packages/enhanced/rstest.config.ts`: include patterns, setupFiles,
|
|
116
|
+
globalSetup, timeouts.
|
|
117
|
+
- `packages/enhanced/tsconfig.spec.json`: replace Jest types with Rstest types.
|
|
118
|
+
- `packages/enhanced/test/setupTestFramework.js`: ensure compatibility with
|
|
119
|
+
Rstest (no `done` usage).
|
|
120
|
+
- `packages/enhanced/test/helpers/webpackMocks.ts`: replace Jest mocks.
|
|
121
|
+
- `packages/enhanced/test/unit/**`: replace Jest APIs and types.
|
|
122
|
+
- `packages/enhanced/test/compiler-unit/**`: replace Jest APIs and types.
|
|
123
|
+
|
|
124
|
+
## References (Rstest docs)
|
|
125
|
+
- https://rstest.rs/llms.txt
|
|
126
|
+
- https://rstest.rs/guide/migration/jest.md
|
|
127
|
+
- https://rstest.rs/guide/basic/cli.md
|
|
128
|
+
- https://rstest.rs/guide/basic/configure-rstest.md
|
|
129
|
+
- https://rstest.rs/guide/basic/projects.md
|
|
130
|
+
- https://rstest.rs/config/test/include.md
|
|
131
|
+
- https://rstest.rs/config/test/setup-files.md
|
|
132
|
+
- https://rstest.rs/config/test/global-setup.md
|
|
133
|
+
- https://rstest.rs/config/test/globals.md
|
|
134
|
+
- https://rstest.rs/config/test/test-environment.md
|
|
135
|
+
- https://rstest.rs/api/runtime-api/test-api/expect.md
|
|
136
|
+
- https://rstest.rs/api/runtime-api/rstest/mock-modules.md
|
|
137
|
+
- https://rstest.rs/api/runtime-api/rstest/mock-functions.md
|
|
138
|
+
- https://rstest.rs/api/runtime-api/rstest/mock-instance.md
|
|
139
|
+
- https://rstest.rs/api/runtime-api/rstest/utilities.md
|
|
140
|
+
- https://rstest.rs/api/javascript-api/rstest-core.md
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
9
|
+
var __exportAll = (all, no_symbols) => {
|
|
10
|
+
let target = {};
|
|
11
|
+
for (var name in all) {
|
|
12
|
+
__defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (!no_symbols) {
|
|
18
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
19
|
+
}
|
|
20
|
+
return target;
|
|
21
|
+
};
|
|
22
|
+
var __copyProps = (to, from, except, desc) => {
|
|
23
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
24
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
25
|
+
key = keys[i];
|
|
26
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
27
|
+
__defProp(to, key, {
|
|
28
|
+
get: ((k) => from[k]).bind(null, key),
|
|
29
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return to;
|
|
35
|
+
};
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
37
|
+
value: mod,
|
|
38
|
+
enumerable: true
|
|
39
|
+
}) : target, mod));
|
|
40
|
+
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
|
|
44
|
+
exports.__esmMin = __esmMin;
|
|
45
|
+
exports.__exportAll = __exportAll;
|
|
46
|
+
exports.__toCommonJS = __toCommonJS;
|
|
47
|
+
exports.__toESM = __toESM;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import ModuleFederationPlugin, { PLUGIN_NAME } from "./wrapper/ModuleFederationPlugin.js";
|
|
2
|
+
import ContainerReferencePlugin from "./wrapper/ContainerReferencePlugin.js";
|
|
3
|
+
import SharePlugin from "./wrapper/SharePlugin.js";
|
|
4
|
+
import ContainerPlugin from "./wrapper/ContainerPlugin.js";
|
|
5
|
+
import ConsumeSharedPlugin from "./wrapper/ConsumeSharedPlugin.js";
|
|
6
|
+
import ProvideSharedPlugin from "./wrapper/ProvideSharedPlugin.js";
|
|
7
|
+
import FederationModulesPlugin from "./wrapper/FederationModulesPlugin.js";
|
|
8
|
+
import FederationRuntimePlugin from "./wrapper/FederationRuntimePlugin.js";
|
|
9
|
+
import AsyncBoundaryPlugin from "./wrapper/AsyncBoundaryPlugin.js";
|
|
10
|
+
import HoistContainerReferencesPlugin from "./wrapper/HoistContainerReferencesPlugin.js";
|
|
11
|
+
import TreeShakingSharedPlugin from "./wrapper/TreeShakingSharedPlugin.js";
|
|
12
|
+
import { parseOptions } from "./lib/container/options.js";
|
|
13
|
+
import { createModuleFederationConfig, moduleFederationPlugin } from "@module-federation/sdk";
|
|
14
|
+
|
|
15
|
+
//#region src/index.d.ts
|
|
16
|
+
declare const dependencies: {
|
|
17
|
+
readonly ContainerEntryDependency: any;
|
|
15
18
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
readonly ContainerEntryModule: any;
|
|
19
|
+
declare const container: {
|
|
20
|
+
readonly ContainerEntryModule: any;
|
|
19
21
|
};
|
|
20
|
-
|
|
21
|
-
export type
|
|
22
|
+
//#endregion
|
|
23
|
+
export { AsyncBoundaryPlugin, ConsumeSharedPlugin, ContainerPlugin, ContainerReferencePlugin, FederationModulesPlugin, FederationRuntimePlugin, HoistContainerReferencesPlugin, ModuleFederationPlugin, PLUGIN_NAME, ProvideSharedPlugin, SharePlugin, TreeShakingSharedPlugin, container, createModuleFederationConfig, dependencies, type moduleFederationPlugin, parseOptions };
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.js
CHANGED
|
@@ -1,44 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
exports.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
exports.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.js');
|
|
3
|
+
const require_wrapper_ModuleFederationPlugin = require('./wrapper/ModuleFederationPlugin.js');
|
|
4
|
+
const require_wrapper_ContainerReferencePlugin = require('./wrapper/ContainerReferencePlugin.js');
|
|
5
|
+
const require_wrapper_SharePlugin = require('./wrapper/SharePlugin.js');
|
|
6
|
+
const require_wrapper_ContainerPlugin = require('./wrapper/ContainerPlugin.js');
|
|
7
|
+
const require_wrapper_ConsumeSharedPlugin = require('./wrapper/ConsumeSharedPlugin.js');
|
|
8
|
+
const require_wrapper_ProvideSharedPlugin = require('./wrapper/ProvideSharedPlugin.js');
|
|
9
|
+
const require_wrapper_FederationModulesPlugin = require('./wrapper/FederationModulesPlugin.js');
|
|
10
|
+
const require_wrapper_FederationRuntimePlugin = require('./wrapper/FederationRuntimePlugin.js');
|
|
11
|
+
const require_wrapper_AsyncBoundaryPlugin = require('./wrapper/AsyncBoundaryPlugin.js');
|
|
12
|
+
const require_wrapper_HoistContainerReferencesPlugin = require('./wrapper/HoistContainerReferencesPlugin.js');
|
|
13
|
+
const require_wrapper_TreeShakingSharedPlugin = require('./wrapper/TreeShakingSharedPlugin.js');
|
|
14
|
+
const require_lib_container_options = require('./lib/container/options.js');
|
|
15
|
+
let _module_federation_sdk = require("@module-federation/sdk");
|
|
16
|
+
|
|
17
|
+
//#region src/index.ts
|
|
18
|
+
const lazyRequire = (id) => module.require(id);
|
|
19
|
+
const dependencies = { get ContainerEntryDependency() {
|
|
20
|
+
return lazyRequire("./lib/container/ContainerEntryDependency").default;
|
|
21
|
+
} };
|
|
22
|
+
const container = { get ContainerEntryModule() {
|
|
23
|
+
return lazyRequire("./lib/container/ContainerEntryModule").default;
|
|
24
|
+
} };
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.AsyncBoundaryPlugin = require_wrapper_AsyncBoundaryPlugin.default;
|
|
28
|
+
exports.ConsumeSharedPlugin = require_wrapper_ConsumeSharedPlugin.default;
|
|
29
|
+
exports.ContainerPlugin = require_wrapper_ContainerPlugin.default;
|
|
30
|
+
exports.ContainerReferencePlugin = require_wrapper_ContainerReferencePlugin.default;
|
|
31
|
+
exports.FederationModulesPlugin = require_wrapper_FederationModulesPlugin.default;
|
|
32
|
+
exports.FederationRuntimePlugin = require_wrapper_FederationRuntimePlugin.default;
|
|
33
|
+
exports.HoistContainerReferencesPlugin = require_wrapper_HoistContainerReferencesPlugin.default;
|
|
34
|
+
exports.ModuleFederationPlugin = require_wrapper_ModuleFederationPlugin.default;
|
|
35
|
+
exports.PLUGIN_NAME = require_wrapper_ModuleFederationPlugin.PLUGIN_NAME;
|
|
36
|
+
exports.ProvideSharedPlugin = require_wrapper_ProvideSharedPlugin.default;
|
|
37
|
+
exports.SharePlugin = require_wrapper_SharePlugin.default;
|
|
38
|
+
exports.TreeShakingSharedPlugin = require_wrapper_TreeShakingSharedPlugin.default;
|
|
39
|
+
exports.container = container;
|
|
40
|
+
Object.defineProperty(exports, 'createModuleFederationConfig', {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return _module_federation_sdk.createModuleFederationConfig;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
exports.dependencies = dependencies;
|
|
47
|
+
exports.parseOptions = require_lib_container_options.parseOptions;
|
|
44
48
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import type { moduleFederationPlugin } from '@module-federation/sdk';\nexport {\n default as ModuleFederationPlugin,\n PLUGIN_NAME,\n} from './wrapper/ModuleFederationPlugin';\nexport { default as ContainerReferencePlugin } from './wrapper/ContainerReferencePlugin';\nexport { default as SharePlugin } from './wrapper/SharePlugin';\nexport { default as ContainerPlugin } from './wrapper/ContainerPlugin';\nexport { default as ConsumeSharedPlugin } from './wrapper/ConsumeSharedPlugin';\nexport { default as ProvideSharedPlugin } from './wrapper/ProvideSharedPlugin';\nexport { default as FederationModulesPlugin } from './wrapper/FederationModulesPlugin';\nexport { default as FederationRuntimePlugin } from './wrapper/FederationRuntimePlugin';\nexport { default as AsyncBoundaryPlugin } from './wrapper/AsyncBoundaryPlugin';\nexport { default as HoistContainerReferencesPlugin } from './wrapper/HoistContainerReferencesPlugin';\nexport { default as TreeShakingSharedPlugin } from './wrapper/TreeShakingSharedPlugin';\n\nconst lazyRequire = (id: string): any => module.require(id);\n\nexport const dependencies = {\n get ContainerEntryDependency() {\n return lazyRequire('./lib/container/ContainerEntryDependency').default;\n },\n};\n\nexport { parseOptions } from './lib/container/options';\n\nexport const container = {\n get ContainerEntryModule() {\n return lazyRequire('./lib/container/ContainerEntryModule').default;\n },\n};\n\nexport { createModuleFederationConfig } from '@module-federation/sdk';\n\nexport type { moduleFederationPlugin };\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,MAAM,eAAe,OAAoB,OAAO,QAAQ,GAAG;AAE3D,MAAa,eAAe,EAC1B,IAAI,2BAA2B;AAC7B,QAAO,YAAY,2CAA2C,CAAC;GAElE;AAID,MAAa,YAAY,EACvB,IAAI,uBAAuB;AACzB,QAAO,YAAY,uCAAuC,CAAC;GAE9D"}
|