@module-federation/enhanced 2.1.0 → 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 -200
- 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 -181
- 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 -132
- 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 -20
- package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +265 -358
- 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 -137
- 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 -103
- 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 -328
- 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 +20 -13
- 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 -222
- 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,149 +1,137 @@
|
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const {
|
|
15
|
-
const
|
|
16
|
-
const
|
|
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_Constants = require('../Constants.js');
|
|
6
|
+
const require_lib_container_FallbackItemDependency = require('./FallbackItemDependency.js');
|
|
7
|
+
let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
|
|
8
|
+
|
|
9
|
+
//#region src/lib/container/FallbackModule.ts
|
|
10
|
+
const { sources: webpackSources } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack"));
|
|
11
|
+
const { Template, Module, RuntimeGlobals } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack"));
|
|
12
|
+
const makeSerializable = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/util/makeSerializable"));
|
|
13
|
+
const TYPES = new Set(["javascript"]);
|
|
17
14
|
const RUNTIME_REQUIREMENTS = new Set([RuntimeGlobals.module]);
|
|
18
|
-
class FallbackModule extends Module {
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
*/
|
|
140
|
-
static deserialize(context) {
|
|
141
|
-
const { read } = context;
|
|
142
|
-
const obj = new FallbackModule(read());
|
|
143
|
-
obj.deserialize(context);
|
|
144
|
-
return obj;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
makeSerializable(FallbackModule, 'enhanced/lib/container/FallbackModule');
|
|
15
|
+
var FallbackModule = class FallbackModule extends Module {
|
|
16
|
+
/**
|
|
17
|
+
* @param {string[]} requests list of requests to choose one
|
|
18
|
+
*/
|
|
19
|
+
constructor(requests) {
|
|
20
|
+
super(require_lib_Constants.WEBPACK_MODULE_TYPE_FALLBACK);
|
|
21
|
+
this.requests = requests;
|
|
22
|
+
this._identifier = `fallback ${this.requests.join(" ")}`;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @returns {string} a unique identifier of the module
|
|
26
|
+
*/
|
|
27
|
+
identifier() {
|
|
28
|
+
return this._identifier;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @param {RequestShortener} requestShortener the request shortener
|
|
32
|
+
* @returns {string} a user readable identifier of the module
|
|
33
|
+
*/
|
|
34
|
+
readableIdentifier(requestShortener) {
|
|
35
|
+
return this._identifier;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @param {LibIdentOptions} options options
|
|
39
|
+
* @returns {string | null} an identifier for library inclusion
|
|
40
|
+
*/
|
|
41
|
+
libIdent(options) {
|
|
42
|
+
return `${this.layer ? `(${this.layer})/` : ""}webpack/container/fallback/${this.requests[0]}/and ${this.requests.length - 1} more`;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @param {Chunk} chunk the chunk which condition should be checked
|
|
46
|
+
* @param {Compilation} compilation the compilation
|
|
47
|
+
* @returns {boolean} true, if the chunk is ok for the module
|
|
48
|
+
*/
|
|
49
|
+
chunkCondition(chunk, { chunkGraph }) {
|
|
50
|
+
return chunkGraph.getNumberOfEntryModules(chunk) > 0;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @param {NeedBuildContext} context context info
|
|
54
|
+
* @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild
|
|
55
|
+
* @returns {void}
|
|
56
|
+
*/
|
|
57
|
+
needBuild(context, callback) {
|
|
58
|
+
callback(null, !this.buildInfo);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @param {WebpackOptions} options webpack options
|
|
62
|
+
* @param {Compilation} compilation the compilation
|
|
63
|
+
* @param {ResolverWithOptions} resolver the resolver
|
|
64
|
+
* @param {InputFileSystem} fs the file system
|
|
65
|
+
* @param {function(WebpackError=): void} callback callback function
|
|
66
|
+
* @returns {void}
|
|
67
|
+
*/
|
|
68
|
+
build(options, compilation, resolver, fs, callback) {
|
|
69
|
+
this.buildMeta = {};
|
|
70
|
+
this.buildInfo = { strict: true };
|
|
71
|
+
this.clearDependenciesAndBlocks();
|
|
72
|
+
for (const request of this.requests) this.addDependency(new require_lib_container_FallbackItemDependency.default(request));
|
|
73
|
+
callback();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* @param {string=} type the source type for which the size should be estimated
|
|
77
|
+
* @returns {number} the estimated size of the module (must be non-zero)
|
|
78
|
+
*/
|
|
79
|
+
size(type) {
|
|
80
|
+
return this.requests.length * 5 + 42;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @returns {Set<string>} types available (do not mutate)
|
|
84
|
+
*/
|
|
85
|
+
getSourceTypes() {
|
|
86
|
+
return TYPES;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @param {CodeGenerationContext} context context for code generation
|
|
90
|
+
* @returns {CodeGenerationResult} result
|
|
91
|
+
*/
|
|
92
|
+
codeGeneration({ runtimeTemplate, moduleGraph, chunkGraph }) {
|
|
93
|
+
const ids = this.dependencies.map((dep) => chunkGraph.getModuleId(moduleGraph.getModule(dep)));
|
|
94
|
+
const code = Template.asString([
|
|
95
|
+
`var ids = ${JSON.stringify(ids)};`,
|
|
96
|
+
"var error, result, i = 0;",
|
|
97
|
+
`var loop = ${runtimeTemplate.basicFunction("next", [
|
|
98
|
+
"while(i < ids.length) {",
|
|
99
|
+
Template.indent([`try { next = ${RuntimeGlobals.require}(ids[i++]); } catch(e) { return handleError(e); }`, "if(next) return next.then ? next.then(handleResult, handleError) : handleResult(next);"]),
|
|
100
|
+
"}",
|
|
101
|
+
"if(error) throw error;"
|
|
102
|
+
])}`,
|
|
103
|
+
`var handleResult = ${runtimeTemplate.basicFunction("result", ["if(result) return result;", "return loop();"])};`,
|
|
104
|
+
`var handleError = ${runtimeTemplate.basicFunction("e", ["error = e;", "return loop();"])};`,
|
|
105
|
+
"module.exports = loop();"
|
|
106
|
+
]);
|
|
107
|
+
const sources = /* @__PURE__ */ new Map();
|
|
108
|
+
sources.set("javascript", new webpackSources.RawSource(code));
|
|
109
|
+
return {
|
|
110
|
+
sources,
|
|
111
|
+
runtimeRequirements: RUNTIME_REQUIREMENTS
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* @param {ObjectSerializerContext} context context
|
|
116
|
+
*/
|
|
117
|
+
serialize(context) {
|
|
118
|
+
const { write } = context;
|
|
119
|
+
write(this.requests);
|
|
120
|
+
super.serialize(context);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @param {ObjectDeserializerContext} context context
|
|
124
|
+
* @returns {FallbackModule} deserialized fallback module
|
|
125
|
+
*/
|
|
126
|
+
static deserialize(context) {
|
|
127
|
+
const { read } = context;
|
|
128
|
+
const obj = new FallbackModule(read());
|
|
129
|
+
obj.deserialize(context);
|
|
130
|
+
return obj;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
makeSerializable(FallbackModule, "enhanced/lib/container/FallbackModule");
|
|
134
|
+
|
|
135
|
+
//#endregion
|
|
148
136
|
exports.default = FallbackModule;
|
|
149
137
|
//# sourceMappingURL=FallbackModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FallbackModule.js","
|
|
1
|
+
{"version":3,"file":"FallbackModule.js","names":["WEBPACK_MODULE_TYPE_FALLBACK","FallbackItemDependency"],"sources":["../../../../src/lib/container/FallbackModule.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy\n*/\n\n'use strict';\n\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport type { Chunk, ChunkGraph } from 'webpack';\nimport type {\n CodeGenerationContext,\n CodeGenerationResult,\n Compilation,\n InputFileSystem,\n LibIdentOptions,\n NeedBuildContext,\n ObjectDeserializerContext,\n ObjectSerializerContext,\n RequestShortener,\n ResolverWithOptions,\n WebpackError,\n WebpackOptions,\n} from 'webpack/lib/Module';\nimport { WEBPACK_MODULE_TYPE_FALLBACK } from '../Constants';\nimport FallbackItemDependency from './FallbackItemDependency';\n\nconst { sources: webpackSources } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\nconst { Template, Module, RuntimeGlobals } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\nconst makeSerializable = require(\n normalizeWebpackPath('webpack/lib/util/makeSerializable'),\n) as typeof import('webpack/lib/util/makeSerializable');\n\nconst TYPES = new Set(['javascript']);\nconst RUNTIME_REQUIREMENTS = new Set([RuntimeGlobals.module]);\n\nclass FallbackModule extends Module {\n public requests: string[];\n private _identifier: string;\n\n /**\n * @param {string[]} requests list of requests to choose one\n */\n constructor(requests: string[]) {\n super(WEBPACK_MODULE_TYPE_FALLBACK);\n this.requests = requests;\n this._identifier = `fallback ${this.requests.join(' ')}`;\n }\n\n /**\n * @returns {string} a unique identifier of the module\n */\n override identifier(): string {\n return this._identifier;\n }\n\n /**\n * @param {RequestShortener} requestShortener the request shortener\n * @returns {string} a user readable identifier of the module\n */\n override readableIdentifier(requestShortener: RequestShortener): string {\n return this._identifier;\n }\n\n /**\n * @param {LibIdentOptions} options options\n * @returns {string | null} an identifier for library inclusion\n */\n override libIdent(options: LibIdentOptions): string | null {\n return `${this.layer ? `(${this.layer})/` : ''}webpack/container/fallback/${\n this.requests[0]\n }/and ${this.requests.length - 1} more`;\n }\n\n /**\n * @param {Chunk} chunk the chunk which condition should be checked\n * @param {Compilation} compilation the compilation\n * @returns {boolean} true, if the chunk is ok for the module\n */\n override chunkCondition(\n chunk: Chunk,\n { chunkGraph }: { chunkGraph: ChunkGraph },\n ): boolean {\n return chunkGraph.getNumberOfEntryModules(chunk) > 0;\n }\n\n /**\n * @param {NeedBuildContext} context context info\n * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild\n * @returns {void}\n */\n override needBuild(\n context: NeedBuildContext,\n callback: (error: WebpackError | null, result?: boolean) => void,\n ): void {\n callback(null, !this.buildInfo);\n }\n\n /**\n * @param {WebpackOptions} options webpack options\n * @param {Compilation} compilation the compilation\n * @param {ResolverWithOptions} resolver the resolver\n * @param {InputFileSystem} fs the file system\n * @param {function(WebpackError=): void} callback callback function\n * @returns {void}\n */\n override build(\n options: WebpackOptions,\n compilation: Compilation,\n resolver: ResolverWithOptions,\n fs: InputFileSystem,\n callback: (error?: WebpackError) => void,\n ): void {\n this.buildMeta = {};\n this.buildInfo = {\n strict: true,\n };\n\n this.clearDependenciesAndBlocks();\n for (const request of this.requests)\n this.addDependency(new FallbackItemDependency(request));\n\n callback();\n }\n\n /**\n * @param {string=} type the source type for which the size should be estimated\n * @returns {number} the estimated size of the module (must be non-zero)\n */\n override size(type?: string): number {\n return this.requests.length * 5 + 42;\n }\n\n /**\n * @returns {Set<string>} types available (do not mutate)\n */\n override getSourceTypes(): Set<string> {\n return TYPES;\n }\n\n /**\n * @param {CodeGenerationContext} context context for code generation\n * @returns {CodeGenerationResult} result\n */\n override codeGeneration({\n runtimeTemplate,\n moduleGraph,\n chunkGraph,\n }: CodeGenerationContext): CodeGenerationResult {\n const ids = this.dependencies.map((dep) =>\n // @ts-expect-error incompatible dependency type\n chunkGraph.getModuleId(moduleGraph.getModule(dep)),\n );\n const code = Template.asString([\n `var ids = ${JSON.stringify(ids)};`,\n 'var error, result, i = 0;',\n `var loop = ${runtimeTemplate.basicFunction('next', [\n 'while(i < ids.length) {',\n Template.indent([\n `try { next = ${RuntimeGlobals.require}(ids[i++]); } catch(e) { return handleError(e); }`,\n 'if(next) return next.then ? next.then(handleResult, handleError) : handleResult(next);',\n ]),\n '}',\n 'if(error) throw error;',\n ])}`,\n `var handleResult = ${runtimeTemplate.basicFunction('result', [\n 'if(result) return result;',\n 'return loop();',\n ])};`,\n `var handleError = ${runtimeTemplate.basicFunction('e', [\n 'error = e;',\n 'return loop();',\n ])};`,\n 'module.exports = loop();',\n ]);\n const sources = new Map();\n sources.set('javascript', new webpackSources.RawSource(code));\n return { sources, runtimeRequirements: RUNTIME_REQUIREMENTS };\n }\n\n /**\n * @param {ObjectSerializerContext} context context\n */\n override serialize(context: ObjectSerializerContext): void {\n const { write } = context;\n write(this.requests);\n super.serialize(context);\n }\n\n /**\n * @param {ObjectDeserializerContext} context context\n * @returns {FallbackModule} deserialized fallback module\n */\n static deserialize(context: ObjectDeserializerContext): FallbackModule {\n const { read } = context;\n const obj = new FallbackModule(read());\n obj.deserialize(context);\n return obj;\n }\n}\n\nmakeSerializable(FallbackModule, 'enhanced/lib/container/FallbackModule');\n\nexport default FallbackModule;\n"],"mappings":";;;;;;;;;AA0BA,MAAM,EAAE,SAAS,mBAAmB,gFACb,UAAU,CAChC;AACD,MAAM,EAAE,UAAU,QAAQ,mBAAmB,gFACtB,UAAU,CAChC;AACD,MAAM,mBAAmB,gFACF,oCAAoC,CAC1D;AAED,MAAM,QAAQ,IAAI,IAAI,CAAC,aAAa,CAAC;AACrC,MAAM,uBAAuB,IAAI,IAAI,CAAC,eAAe,OAAO,CAAC;AAE7D,IAAM,iBAAN,MAAM,uBAAuB,OAAO;;;;CAOlC,YAAY,UAAoB;AAC9B,QAAMA,mDAA6B;AACnC,OAAK,WAAW;AAChB,OAAK,cAAc,YAAY,KAAK,SAAS,KAAK,IAAI;;;;;CAMxD,AAAS,aAAqB;AAC5B,SAAO,KAAK;;;;;;CAOd,AAAS,mBAAmB,kBAA4C;AACtE,SAAO,KAAK;;;;;;CAOd,AAAS,SAAS,SAAyC;AACzD,SAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,MAAM,MAAM,GAAG,6BAC7C,KAAK,SAAS,GACf,OAAO,KAAK,SAAS,SAAS,EAAE;;;;;;;CAQnC,AAAS,eACP,OACA,EAAE,cACO;AACT,SAAO,WAAW,wBAAwB,MAAM,GAAG;;;;;;;CAQrD,AAAS,UACP,SACA,UACM;AACN,WAAS,MAAM,CAAC,KAAK,UAAU;;;;;;;;;;CAWjC,AAAS,MACP,SACA,aACA,UACA,IACA,UACM;AACN,OAAK,YAAY,EAAE;AACnB,OAAK,YAAY,EACf,QAAQ,MACT;AAED,OAAK,4BAA4B;AACjC,OAAK,MAAM,WAAW,KAAK,SACzB,MAAK,cAAc,IAAIC,qDAAuB,QAAQ,CAAC;AAEzD,YAAU;;;;;;CAOZ,AAAS,KAAK,MAAuB;AACnC,SAAO,KAAK,SAAS,SAAS,IAAI;;;;;CAMpC,AAAS,iBAA8B;AACrC,SAAO;;;;;;CAOT,AAAS,eAAe,EACtB,iBACA,aACA,cAC8C;EAC9C,MAAM,MAAM,KAAK,aAAa,KAAK,QAEjC,WAAW,YAAY,YAAY,UAAU,IAAI,CAAC,CACnD;EACD,MAAM,OAAO,SAAS,SAAS;GAC7B,aAAa,KAAK,UAAU,IAAI,CAAC;GACjC;GACA,cAAc,gBAAgB,cAAc,QAAQ;IAClD;IACA,SAAS,OAAO,CACd,gBAAgB,eAAe,QAAQ,oDACvC,yFACD,CAAC;IACF;IACA;IACD,CAAC;GACF,sBAAsB,gBAAgB,cAAc,UAAU,CAC5D,6BACA,iBACD,CAAC,CAAC;GACH,qBAAqB,gBAAgB,cAAc,KAAK,CACtD,cACA,iBACD,CAAC,CAAC;GACH;GACD,CAAC;EACF,MAAM,0BAAU,IAAI,KAAK;AACzB,UAAQ,IAAI,cAAc,IAAI,eAAe,UAAU,KAAK,CAAC;AAC7D,SAAO;GAAE;GAAS,qBAAqB;GAAsB;;;;;CAM/D,AAAS,UAAU,SAAwC;EACzD,MAAM,EAAE,UAAU;AAClB,QAAM,KAAK,SAAS;AACpB,QAAM,UAAU,QAAQ;;;;;;CAO1B,OAAO,YAAY,SAAoD;EACrE,MAAM,EAAE,SAAS;EACjB,MAAM,MAAM,IAAI,eAAe,MAAM,CAAC;AACtC,MAAI,YAAY,QAAQ;AACxB,SAAO;;;AAIX,iBAAiB,gBAAgB,wCAAwC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import * as webpack_lib_ModuleFactory0 from "webpack/lib/ModuleFactory";
|
|
2
|
+
import { ModuleFactoryCreateData, ModuleFactoryResult } from "webpack/lib/ModuleFactory";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/container/FallbackModuleFactory.d.ts
|
|
5
|
+
declare const ModuleFactory: typeof webpack_lib_ModuleFactory0;
|
|
6
|
+
declare class FallbackModuleFactory extends ModuleFactory {
|
|
7
|
+
/**
|
|
8
|
+
* @param {ModuleFactoryCreateData} data data object
|
|
9
|
+
* @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
create(data: ModuleFactoryCreateData, callback: (error: Error | null, result?: ModuleFactoryResult) => void): void;
|
|
10
13
|
}
|
|
11
|
-
|
|
14
|
+
//#endregion
|
|
15
|
+
export { FallbackModuleFactory as default };
|
|
16
|
+
//# sourceMappingURL=FallbackModuleFactory.d.ts.map
|
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
/*
|
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
-
Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr
|
|
4
|
-
*/
|
|
5
1
|
'use strict';
|
|
6
|
-
|
|
7
|
-
|
|
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_FallbackModule = require('./FallbackModule.js');
|
|
6
|
+
let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
|
|
7
|
+
|
|
8
|
+
//#region src/lib/container/FallbackModuleFactory.ts
|
|
9
|
+
const ModuleFactory = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/ModuleFactory"));
|
|
10
|
+
var FallbackModuleFactory = class extends ModuleFactory {
|
|
11
|
+
/**
|
|
12
|
+
* @param {ModuleFactoryCreateData} data data object
|
|
13
|
+
* @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
|
|
14
|
+
* @returns {void}
|
|
15
|
+
*/
|
|
16
|
+
create(data, callback) {
|
|
17
|
+
const dependency = data.dependencies[0];
|
|
18
|
+
callback(null, { module: new require_lib_container_FallbackModule.default(dependency.requests) });
|
|
19
|
+
}
|
|
8
20
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const FallbackModule_1 = __importDefault(require("./FallbackModule"));
|
|
12
|
-
const ModuleFactory = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/ModuleFactory'));
|
|
13
|
-
class FallbackModuleFactory extends ModuleFactory {
|
|
14
|
-
/**
|
|
15
|
-
* @param {ModuleFactoryCreateData} data data object
|
|
16
|
-
* @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
|
|
17
|
-
* @returns {void}
|
|
18
|
-
*/
|
|
19
|
-
create(data, callback) {
|
|
20
|
-
const dependency = data.dependencies[0];
|
|
21
|
-
callback(null, {
|
|
22
|
-
// @ts-expect-error Module !== FallbackModule
|
|
23
|
-
module: new FallbackModule_1.default(dependency.requests),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
27
23
|
exports.default = FallbackModuleFactory;
|
|
28
24
|
//# sourceMappingURL=FallbackModuleFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FallbackModuleFactory.js","
|
|
1
|
+
{"version":3,"file":"FallbackModuleFactory.js","names":["FallbackModule"],"sources":["../../../../src/lib/container/FallbackModuleFactory.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr\n*/\n\n'use strict';\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport type {\n ModuleFactoryCreateData,\n ModuleFactoryResult,\n} from 'webpack/lib/ModuleFactory';\nimport FallbackModule from './FallbackModule';\n\nconst ModuleFactory = require(\n normalizeWebpackPath('webpack/lib/ModuleFactory'),\n) as typeof import('webpack/lib/ModuleFactory');\n\nexport default class FallbackModuleFactory extends ModuleFactory {\n /**\n * @param {ModuleFactoryCreateData} data data object\n * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback\n * @returns {void}\n */\n override create(\n data: ModuleFactoryCreateData,\n callback: (error: Error | null, result?: ModuleFactoryResult) => void,\n ): void {\n const dependency = data.dependencies[0];\n callback(null, {\n // @ts-expect-error Module !== FallbackModule\n module: new FallbackModule(dependency.requests),\n });\n }\n}\n"],"mappings":";;;;;;;;AAaA,MAAM,gBAAgB,gFACC,4BAA4B,CAClD;AAED,IAAqB,wBAArB,cAAmD,cAAc;;;;;;CAM/D,AAAS,OACP,MACA,UACM;EACN,MAAM,aAAa,KAAK,aAAa;AACrC,WAAS,MAAM,EAEb,QAAQ,IAAIA,6CAAe,WAAW,SAAS,EAChD,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Compilation, Compiler, Module, WebpackPluginInstance } from "webpack";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/container/HoistContainerReferencesPlugin.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* This plugin hoists container-related modules into runtime chunks when using runtimeChunk: single configuration.
|
|
4
6
|
*/
|
|
5
7
|
declare class HoistContainerReferences implements WebpackPluginInstance {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
apply(compiler: Compiler): void;
|
|
9
|
+
private hoistModulesInChunks;
|
|
10
|
+
private cleanUpChunks;
|
|
11
|
+
private getRuntimeChunks;
|
|
10
12
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
declare function getAllReferencedModules(compilation: Compilation, module: Module, type?: 'all' | 'initial' | 'external'): Set<Module>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { HoistContainerReferences as default, getAllReferencedModules };
|
|
16
|
+
//# sourceMappingURL=HoistContainerReferencesPlugin.d.ts.map
|