@module-federation/modern-js 0.0.0-chore-bump-node-22-20260710161714
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/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/cjs/cli/configPlugin.js +346 -0
- package/dist/cjs/cli/index.js +115 -0
- package/dist/cjs/cli/mfRuntimePlugins/inject-node-fetch.js +54 -0
- package/dist/cjs/cli/mfRuntimePlugins/shared-strategy.js +53 -0
- package/dist/cjs/cli/server/data-fetch-server-plugin.js +59 -0
- package/dist/cjs/cli/ssrPlugin.js +314 -0
- package/dist/cjs/cli/utils.js +93 -0
- package/dist/cjs/constant.js +40 -0
- package/dist/cjs/interfaces/bundler.js +18 -0
- package/dist/cjs/logger.js +39 -0
- package/dist/cjs/react/data-fetch.js +58 -0
- package/dist/cjs/react/index.js +58 -0
- package/dist/cjs/react/plugin.js +65 -0
- package/dist/cjs/react/v18.js +58 -0
- package/dist/cjs/react/v19.js +58 -0
- package/dist/cjs/runtime/index.js +58 -0
- package/dist/cjs/server/fileCache.js +82 -0
- package/dist/cjs/server/index.js +71 -0
- package/dist/cjs/server/staticMiddleware.js +97 -0
- package/dist/cjs/ssr-runtime/SSRLiveReload.js +50 -0
- package/dist/cjs/ssr-runtime/devPlugin.js +67 -0
- package/dist/cjs/ssr-runtime/injectDataFetchFunctionPlugin.js +47 -0
- package/dist/cjs/types/index.js +18 -0
- package/dist/esm/cli/configPlugin.mjs +321 -0
- package/dist/esm/cli/index.mjs +91 -0
- package/dist/esm/cli/mfRuntimePlugins/inject-node-fetch.mjs +12 -0
- package/dist/esm/cli/mfRuntimePlugins/shared-strategy.mjs +21 -0
- package/dist/esm/cli/server/data-fetch-server-plugin.mjs +17 -0
- package/dist/esm/cli/ssrPlugin.mjs +297 -0
- package/dist/esm/cli/utils.mjs +40 -0
- package/dist/esm/constant.mjs +3 -0
- package/dist/esm/interfaces/bundler.mjs +0 -0
- package/dist/esm/logger.mjs +5 -0
- package/dist/esm/react/data-fetch.mjs +1 -0
- package/dist/esm/react/index.mjs +1 -0
- package/dist/esm/react/plugin.mjs +3 -0
- package/dist/esm/react/v18.mjs +1 -0
- package/dist/esm/react/v19.mjs +1 -0
- package/dist/esm/runtime/index.mjs +1 -0
- package/dist/esm/server/fileCache.mjs +125 -0
- package/dist/esm/server/index.mjs +36 -0
- package/dist/esm/server/staticMiddleware.mjs +122 -0
- package/dist/esm/ssr-runtime/SSRLiveReload.mjs +23 -0
- package/dist/esm/ssr-runtime/devPlugin.mjs +70 -0
- package/dist/esm/ssr-runtime/injectDataFetchFunctionPlugin.mjs +33 -0
- package/dist/esm/types/index.mjs +0 -0
- package/dist/esm-node/cli/configPlugin.mjs +276 -0
- package/dist/esm-node/cli/index.mjs +75 -0
- package/dist/esm-node/cli/mfRuntimePlugins/inject-node-fetch.mjs +10 -0
- package/dist/esm-node/cli/mfRuntimePlugins/shared-strategy.mjs +19 -0
- package/dist/esm-node/cli/server/data-fetch-server-plugin.mjs +15 -0
- package/dist/esm-node/cli/ssrPlugin.mjs +258 -0
- package/dist/esm-node/cli/utils.mjs +40 -0
- package/dist/esm-node/constant.mjs +3 -0
- package/dist/esm-node/interfaces/bundler.mjs +0 -0
- package/dist/esm-node/logger.mjs +5 -0
- package/dist/esm-node/react/data-fetch.mjs +1 -0
- package/dist/esm-node/react/index.mjs +1 -0
- package/dist/esm-node/react/plugin.mjs +3 -0
- package/dist/esm-node/react/v18.mjs +1 -0
- package/dist/esm-node/react/v19.mjs +1 -0
- package/dist/esm-node/runtime/index.mjs +1 -0
- package/dist/esm-node/server/fileCache.mjs +45 -0
- package/dist/esm-node/server/index.mjs +34 -0
- package/dist/esm-node/server/staticMiddleware.mjs +50 -0
- package/dist/esm-node/ssr-runtime/SSRLiveReload.mjs +16 -0
- package/dist/esm-node/ssr-runtime/devPlugin.mjs +33 -0
- package/dist/esm-node/ssr-runtime/injectDataFetchFunctionPlugin.mjs +13 -0
- package/dist/esm-node/types/index.mjs +0 -0
- package/dist/types/cli/configPlugin.d.ts +21 -0
- package/dist/types/cli/configPlugin.spec.d.ts +1 -0
- package/dist/types/cli/index.d.ts +6 -0
- package/dist/types/cli/mfRuntimePlugins/inject-node-fetch.d.ts +3 -0
- package/dist/types/cli/mfRuntimePlugins/shared-strategy.d.ts +3 -0
- package/dist/types/cli/server/data-fetch-server-plugin.d.ts +3 -0
- package/dist/types/cli/ssrPlugin.d.ts +6 -0
- package/dist/types/cli/ssrPlugin.spec.d.ts +1 -0
- package/dist/types/cli/utils.d.ts +6 -0
- package/dist/types/constant.d.ts +2 -0
- package/dist/types/interfaces/bundler.d.ts +18 -0
- package/dist/types/logger.d.ts +2 -0
- package/dist/types/react/data-fetch.d.ts +1 -0
- package/dist/types/react/index.d.ts +1 -0
- package/dist/types/react/plugin.d.ts +2 -0
- package/dist/types/react/v18.d.ts +1 -0
- package/dist/types/react/v19.d.ts +1 -0
- package/dist/types/runtime/index.d.ts +1 -0
- package/dist/types/server/fileCache.d.ts +14 -0
- package/dist/types/server/fileCache.spec.d.ts +1 -0
- package/dist/types/server/index.d.ts +4 -0
- package/dist/types/server/staticMiddleware.d.ts +7 -0
- package/dist/types/server/staticMiddleware.spec.d.ts +1 -0
- package/dist/types/ssr-runtime/SSRLiveReload.d.ts +2 -0
- package/dist/types/ssr-runtime/devPlugin.d.ts +2 -0
- package/dist/types/ssr-runtime/injectDataFetchFunctionPlugin.d.ts +4 -0
- package/dist/types/types/index.d.ts +35 -0
- package/package.json +192 -0
- package/types.d.ts +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-present zhanghang(2heal1)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
jiti (module) {
|
|
4
|
+
module.exports = require("jiti");
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
var __webpack_module_cache__ = {};
|
|
8
|
+
function __webpack_require__(moduleId) {
|
|
9
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
+
exports: {}
|
|
13
|
+
};
|
|
14
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
+
return module.exports;
|
|
16
|
+
}
|
|
17
|
+
(()=>{
|
|
18
|
+
__webpack_require__.n = (module)=>{
|
|
19
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
20
|
+
__webpack_require__.d(getter, {
|
|
21
|
+
a: getter
|
|
22
|
+
});
|
|
23
|
+
return getter;
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
(()=>{
|
|
27
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
28
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: definition[key]
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
34
|
+
(()=>{
|
|
35
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
36
|
+
})();
|
|
37
|
+
(()=>{
|
|
38
|
+
__webpack_require__.r = (exports1)=>{
|
|
39
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
40
|
+
value: 'Module'
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
43
|
+
value: true
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
var __webpack_exports__ = {};
|
|
48
|
+
(()=>{
|
|
49
|
+
__webpack_require__.r(__webpack_exports__);
|
|
50
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
51
|
+
patchMFConfig: ()=>patchMFConfig,
|
|
52
|
+
default: ()=>configPlugin,
|
|
53
|
+
getMFConfig: ()=>getMFConfig,
|
|
54
|
+
isWebTarget: ()=>external_utils_js_namespaceObject.isWebTarget,
|
|
55
|
+
moduleFederationConfigPlugin: ()=>moduleFederationConfigPlugin,
|
|
56
|
+
addMyTypes2Ignored: ()=>addMyTypes2Ignored,
|
|
57
|
+
skipByTarget: ()=>external_utils_js_namespaceObject.skipByTarget,
|
|
58
|
+
setEnv: ()=>setEnv,
|
|
59
|
+
patchBundlerConfig: ()=>patchBundlerConfig
|
|
60
|
+
});
|
|
61
|
+
const external_fs_namespaceObject = require("fs");
|
|
62
|
+
var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
|
|
63
|
+
const external_path_namespaceObject = require("path");
|
|
64
|
+
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
65
|
+
const external_utils_js_namespaceObject = require("./utils.js");
|
|
66
|
+
const sdk_namespaceObject = require("@module-federation/sdk");
|
|
67
|
+
const external_constant_js_namespaceObject = require("../constant.js");
|
|
68
|
+
const utils_namespaceObject = require("@module-federation/rsbuild-plugin/utils");
|
|
69
|
+
const external_logger_js_namespaceObject = require("../logger.js");
|
|
70
|
+
var external_logger_js_default = /*#__PURE__*/ __webpack_require__.n(external_logger_js_namespaceObject);
|
|
71
|
+
const defaultPath = external_path_default().resolve(process.cwd(), 'module-federation.config.ts');
|
|
72
|
+
const resolvePackageFile = (packageName, esmRelativePath, cjsRelativePath)=>{
|
|
73
|
+
const packageEntry = require.resolve(packageName);
|
|
74
|
+
let packageRoot = external_path_default().dirname(packageEntry);
|
|
75
|
+
while(!external_fs_default().existsSync(external_path_default().join(packageRoot, 'package.json'))){
|
|
76
|
+
const parentDir = external_path_default().dirname(packageRoot);
|
|
77
|
+
if (parentDir === packageRoot) throw new Error(`Unable to resolve package root for ${packageName} from ${packageEntry}`);
|
|
78
|
+
packageRoot = parentDir;
|
|
79
|
+
}
|
|
80
|
+
return require.resolve(external_path_default().join(packageRoot, 'true' === process.env['IS_ESM_BUILD'] ? esmRelativePath : cjsRelativePath));
|
|
81
|
+
};
|
|
82
|
+
const resolveSharedStrategyPlugin = ()=>resolvePackageFile('@module-federation/modern-js', 'dist/esm/cli/mfRuntimePlugins/shared-strategy.mjs', 'dist/cjs/cli/mfRuntimePlugins/shared-strategy.js');
|
|
83
|
+
const resolveInjectNodeFetchPlugin = ()=>resolvePackageFile('@module-federation/modern-js', 'dist/esm/cli/mfRuntimePlugins/inject-node-fetch.mjs', 'dist/cjs/cli/mfRuntimePlugins/inject-node-fetch.js');
|
|
84
|
+
const resolveNodeRuntimePlugin = ()=>resolvePackageFile('@module-federation/node', 'dist/src/runtimePlugin.mjs', 'dist/src/runtimePlugin.js');
|
|
85
|
+
const resolveNodeRecordRemoteHashPlugin = ()=>resolvePackageFile('@module-federation/node', 'dist/src/recordDynamicRemoteEntryHashPlugin.mjs', 'dist/src/recordDynamicRemoteEntryHashPlugin.js');
|
|
86
|
+
function setEnv(enableSSR) {
|
|
87
|
+
if (enableSSR) process.env['MF_SSR_PRJ'] = 'true';
|
|
88
|
+
}
|
|
89
|
+
const getMFConfig = async (userConfig)=>{
|
|
90
|
+
const { config, configPath } = userConfig;
|
|
91
|
+
if (config) return config;
|
|
92
|
+
const mfConfigPath = configPath ? configPath : defaultPath;
|
|
93
|
+
const { createJiti } = __webpack_require__("jiti");
|
|
94
|
+
const jit = createJiti(__filename, {
|
|
95
|
+
interopDefault: true
|
|
96
|
+
});
|
|
97
|
+
const configModule = await jit(mfConfigPath);
|
|
98
|
+
const resolvedConfig = configModule && 'object' == typeof configModule && 'default' in configModule ? configModule.default : configModule;
|
|
99
|
+
return resolvedConfig;
|
|
100
|
+
};
|
|
101
|
+
const injectRuntimePlugins = (runtimePlugin, runtimePlugins)=>{
|
|
102
|
+
const pluginName = 'string' == typeof runtimePlugin ? runtimePlugin : runtimePlugin[0];
|
|
103
|
+
const hasPlugin = runtimePlugins.some((existingPlugin)=>{
|
|
104
|
+
if ('string' == typeof existingPlugin) return existingPlugin === pluginName;
|
|
105
|
+
return existingPlugin[0] === pluginName;
|
|
106
|
+
});
|
|
107
|
+
if (!hasPlugin) runtimePlugins.push(runtimePlugin);
|
|
108
|
+
};
|
|
109
|
+
const patchDTSConfig = (mfConfig, isServer)=>{
|
|
110
|
+
if (isServer) return;
|
|
111
|
+
const ModernJSRuntime = '@module-federation/modern-js/runtime';
|
|
112
|
+
if (false !== mfConfig.dts) {
|
|
113
|
+
var _mfConfig_dts, _mfConfig_dts1;
|
|
114
|
+
if ('boolean' == typeof mfConfig.dts || void 0 === mfConfig.dts) mfConfig.dts = {
|
|
115
|
+
consumeTypes: {
|
|
116
|
+
runtimePkgs: [
|
|
117
|
+
ModernJSRuntime
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
else if ((null == (_mfConfig_dts = mfConfig.dts) ? void 0 : _mfConfig_dts.consumeTypes) || (null == (_mfConfig_dts1 = mfConfig.dts) ? void 0 : _mfConfig_dts1.consumeTypes) === void 0) {
|
|
122
|
+
var _mfConfig_dts2;
|
|
123
|
+
if ('boolean' == typeof mfConfig.dts.consumeTypes || (null == (_mfConfig_dts2 = mfConfig.dts) ? void 0 : _mfConfig_dts2.consumeTypes) === void 0) mfConfig.dts.consumeTypes = {
|
|
124
|
+
runtimePkgs: [
|
|
125
|
+
ModernJSRuntime
|
|
126
|
+
]
|
|
127
|
+
};
|
|
128
|
+
else {
|
|
129
|
+
mfConfig.dts.consumeTypes.runtimePkgs = mfConfig.dts.consumeTypes.runtimePkgs || [];
|
|
130
|
+
if (!mfConfig.dts.consumeTypes.runtimePkgs.includes(ModernJSRuntime)) mfConfig.dts.consumeTypes.runtimePkgs.push(ModernJSRuntime);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const patchMFConfig = (mfConfig, isServer)=>{
|
|
136
|
+
(0, utils_namespaceObject.addDataFetchExposes)(mfConfig.exposes, isServer);
|
|
137
|
+
if (void 0 === mfConfig.remoteType) mfConfig.remoteType = "script";
|
|
138
|
+
if (!mfConfig.name) throw new Error(`${external_constant_js_namespaceObject.PLUGIN_IDENTIFIER} mfConfig.name can not be empty!`);
|
|
139
|
+
const runtimePlugins = [
|
|
140
|
+
...mfConfig.runtimePlugins || []
|
|
141
|
+
];
|
|
142
|
+
patchDTSConfig(mfConfig, isServer);
|
|
143
|
+
injectRuntimePlugins(resolveSharedStrategyPlugin(), runtimePlugins);
|
|
144
|
+
if (isServer) {
|
|
145
|
+
injectRuntimePlugins(resolveNodeRuntimePlugin(), runtimePlugins);
|
|
146
|
+
if ((0, external_utils_js_namespaceObject.isDev)()) injectRuntimePlugins(resolveNodeRecordRemoteHashPlugin(), runtimePlugins);
|
|
147
|
+
injectRuntimePlugins(resolveInjectNodeFetchPlugin(), runtimePlugins);
|
|
148
|
+
if (mfConfig.library) {
|
|
149
|
+
if (!mfConfig.library.type) mfConfig.library.type = 'commonjs-module';
|
|
150
|
+
if (!mfConfig.library.name) mfConfig.library.name = mfConfig.name;
|
|
151
|
+
} else mfConfig.library = {
|
|
152
|
+
type: 'commonjs-module',
|
|
153
|
+
name: mfConfig.name
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
mfConfig.runtimePlugins = runtimePlugins;
|
|
157
|
+
if (!isServer) {
|
|
158
|
+
var _mfConfig_library;
|
|
159
|
+
if ((null == (_mfConfig_library = mfConfig.library) ? void 0 : _mfConfig_library.type) === 'commonjs-module') mfConfig.library.type = 'global';
|
|
160
|
+
return mfConfig;
|
|
161
|
+
}
|
|
162
|
+
mfConfig.dts = false;
|
|
163
|
+
mfConfig.dev = false;
|
|
164
|
+
return mfConfig;
|
|
165
|
+
};
|
|
166
|
+
function patchIgnoreWarning(chain) {
|
|
167
|
+
const ignoreWarnings = chain.get('ignoreWarnings') || [];
|
|
168
|
+
const ignoredMsgs = [
|
|
169
|
+
"external script",
|
|
170
|
+
'process.env.WS_NO_BUFFER_UTIL',
|
|
171
|
+
"Can't resolve 'utf-8-validate"
|
|
172
|
+
];
|
|
173
|
+
ignoreWarnings.push((warning)=>{
|
|
174
|
+
if (ignoredMsgs.some((msg)=>warning.message.includes(msg))) return true;
|
|
175
|
+
return false;
|
|
176
|
+
});
|
|
177
|
+
chain.ignoreWarnings(ignoreWarnings);
|
|
178
|
+
}
|
|
179
|
+
function addMyTypes2Ignored(chain, mfConfig) {
|
|
180
|
+
const watchOptions = chain.get('watchOptions');
|
|
181
|
+
if (!watchOptions || !watchOptions.ignored) return void chain.watchOptions({
|
|
182
|
+
ignored: /[\\/](?:\.git|node_modules|@mf-types)[\\/]/
|
|
183
|
+
});
|
|
184
|
+
const ignored = watchOptions.ignored;
|
|
185
|
+
const DEFAULT_IGNORED_GLOB = '**/@mf-types/**';
|
|
186
|
+
if (Array.isArray(ignored)) {
|
|
187
|
+
if (false !== mfConfig.dts && 'object' == typeof mfConfig.dts && 'object' == typeof mfConfig.dts.consumeTypes && mfConfig.dts.consumeTypes.remoteTypesFolder) chain.watchOptions({
|
|
188
|
+
...watchOptions,
|
|
189
|
+
ignored: ignored.concat(`**/${mfConfig.dts.consumeTypes.remoteTypesFolder}/**`)
|
|
190
|
+
});
|
|
191
|
+
else chain.watchOptions({
|
|
192
|
+
...watchOptions,
|
|
193
|
+
ignored: ignored.concat(DEFAULT_IGNORED_GLOB)
|
|
194
|
+
});
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if ('string' != typeof ignored) return void chain.watchOptions({
|
|
198
|
+
...watchOptions,
|
|
199
|
+
ignored: /[\\/](?:\.git|node_modules|@mf-types)[\\/]/
|
|
200
|
+
});
|
|
201
|
+
chain.watchOptions({
|
|
202
|
+
...watchOptions,
|
|
203
|
+
ignored: ignored.concat(DEFAULT_IGNORED_GLOB)
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
function patchBundlerConfig(options) {
|
|
207
|
+
var _modernjsConfig_deploy;
|
|
208
|
+
const { chain, modernjsConfig, isServer, mfConfig, enableSSR } = options;
|
|
209
|
+
chain.optimization.delete('runtimeChunk');
|
|
210
|
+
patchIgnoreWarning(chain);
|
|
211
|
+
if (!chain.output.get('chunkLoadingGlobal')) chain.output.chunkLoadingGlobal(`chunk_${mfConfig.name}`);
|
|
212
|
+
if (!chain.output.get('uniqueName')) chain.output.uniqueName(mfConfig.name);
|
|
213
|
+
const splitChunkConfig = chain.optimization.splitChunks.entries();
|
|
214
|
+
if (!isServer) (0, utils_namespaceObject.autoDeleteSplitChunkCacheGroups)(mfConfig, splitChunkConfig);
|
|
215
|
+
if (!isServer && enableSSR && splitChunkConfig && 'object' == typeof splitChunkConfig && splitChunkConfig.cacheGroups) {
|
|
216
|
+
splitChunkConfig.chunks = 'async';
|
|
217
|
+
external_logger_js_default().warn('splitChunks.chunks = async is not allowed with stream SSR mode, it will auto changed to "async"');
|
|
218
|
+
}
|
|
219
|
+
if ((0, external_utils_js_namespaceObject.isDev)() && 'auto' === chain.output.get('publicPath')) {
|
|
220
|
+
var _modernjsConfig_dev, _modernjsConfig_server;
|
|
221
|
+
const port = (null == (_modernjsConfig_dev = modernjsConfig.dev) ? void 0 : _modernjsConfig_dev.port) || (null == (_modernjsConfig_server = modernjsConfig.server) ? void 0 : _modernjsConfig_server.port) || 8080;
|
|
222
|
+
const publicPath = `http://localhost:${port}/`;
|
|
223
|
+
chain.output.publicPath(publicPath);
|
|
224
|
+
}
|
|
225
|
+
if (isServer && enableSSR) {
|
|
226
|
+
const uniqueName = mfConfig.name || chain.output.get('uniqueName');
|
|
227
|
+
const chunkFileName = chain.output.get('chunkFilename');
|
|
228
|
+
if ('string' == typeof chunkFileName && uniqueName && !chunkFileName.includes(uniqueName)) {
|
|
229
|
+
const suffix = `${(0, sdk_namespaceObject.encodeName)(uniqueName)}-[contenthash].js`;
|
|
230
|
+
chain.output.chunkFilename(chunkFileName.replace('.js', suffix));
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if ((0, external_utils_js_namespaceObject.isDev)() && enableSSR && !isServer) chain.resolve.fallback.set('crypto', false).set('stream', false).set('vm', false);
|
|
234
|
+
if ((null == (_modernjsConfig_deploy = modernjsConfig.deploy) ? void 0 : _modernjsConfig_deploy.microFrontend) && Object.keys(mfConfig.exposes || {}).length) chain.optimization.usedExports(false);
|
|
235
|
+
}
|
|
236
|
+
const moduleFederationConfigPlugin = (userConfig)=>({
|
|
237
|
+
name: '@modern-js/plugin-module-federation-config',
|
|
238
|
+
pre: [
|
|
239
|
+
'@modern-js/plugin-initialize'
|
|
240
|
+
],
|
|
241
|
+
post: [
|
|
242
|
+
'@modern-js/plugin-module-federation'
|
|
243
|
+
],
|
|
244
|
+
setup: async (api)=>{
|
|
245
|
+
var _ref;
|
|
246
|
+
var _userConfig_userConfig, _modernjsConfig_server;
|
|
247
|
+
const modernjsConfig = api.getConfig();
|
|
248
|
+
const mfConfig = await getMFConfig(userConfig.originPluginOptions);
|
|
249
|
+
const csrConfig = userConfig.csrConfig || JSON.parse(JSON.stringify(mfConfig));
|
|
250
|
+
const ssrConfig = userConfig.ssrConfig || JSON.parse(JSON.stringify(mfConfig));
|
|
251
|
+
userConfig.ssrConfig = ssrConfig;
|
|
252
|
+
userConfig.csrConfig = csrConfig;
|
|
253
|
+
const enableSSR = Boolean(null != (_ref = null == (_userConfig_userConfig = userConfig.userConfig) ? void 0 : _userConfig_userConfig.ssr) ? _ref : Boolean(null == modernjsConfig ? void 0 : null == (_modernjsConfig_server = modernjsConfig.server) ? void 0 : _modernjsConfig_server.ssr));
|
|
254
|
+
api.modifyBundlerChain((chain)=>{
|
|
255
|
+
var _modernjsConfig_source, _targetMFConfig_experiments;
|
|
256
|
+
const bundlerType = 'rspack' === api.getAppContext().bundlerType ? 'rspack' : 'webpack';
|
|
257
|
+
const target = chain.get('target');
|
|
258
|
+
if ((0, external_utils_js_namespaceObject.skipByTarget)(target)) return;
|
|
259
|
+
const isWeb = (0, external_utils_js_namespaceObject.isWebTarget)(target);
|
|
260
|
+
addMyTypes2Ignored(chain, isWeb ? csrConfig : ssrConfig);
|
|
261
|
+
const targetMFConfig = isWeb ? csrConfig : ssrConfig;
|
|
262
|
+
patchMFConfig(targetMFConfig, !isWeb);
|
|
263
|
+
if ('rspack' === bundlerType && (null == (_modernjsConfig_source = modernjsConfig.source) ? void 0 : _modernjsConfig_source.enableAsyncEntry) !== true && (null == (_targetMFConfig_experiments = targetMFConfig.experiments) ? void 0 : _targetMFConfig_experiments.asyncStartup) !== false) {
|
|
264
|
+
var _targetMFConfig;
|
|
265
|
+
(_targetMFConfig = targetMFConfig).experiments || (_targetMFConfig.experiments = {});
|
|
266
|
+
targetMFConfig.experiments.asyncStartup = true;
|
|
267
|
+
}
|
|
268
|
+
patchBundlerConfig({
|
|
269
|
+
chain,
|
|
270
|
+
isServer: !isWeb,
|
|
271
|
+
modernjsConfig,
|
|
272
|
+
mfConfig,
|
|
273
|
+
enableSSR
|
|
274
|
+
});
|
|
275
|
+
if (isWeb) userConfig.distOutputDir = chain.output.get('path') || external_path_default().resolve(process.cwd(), 'dist');
|
|
276
|
+
else if (enableSSR) {
|
|
277
|
+
var _userConfig, _userConfig_userConfig;
|
|
278
|
+
(_userConfig = userConfig).userConfig || (_userConfig.userConfig = {});
|
|
279
|
+
(_userConfig_userConfig = userConfig.userConfig).ssr || (_userConfig_userConfig.ssr = {});
|
|
280
|
+
if (true === userConfig.userConfig.ssr) userConfig.userConfig.ssr = {};
|
|
281
|
+
userConfig.userConfig.ssr.distOutputDir = chain.output.get('path') || external_path_default().resolve(process.cwd(), 'dist/bundles');
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
api.config(()=>{
|
|
285
|
+
var _ref;
|
|
286
|
+
var _modernjsConfig_tools, _userConfig_csrConfig, _modernjsConfig_source, _modernjsConfig_source1, _modernjsConfig_dev;
|
|
287
|
+
const bundlerType = 'rspack' === api.getAppContext().bundlerType ? 'rspack' : 'webpack';
|
|
288
|
+
const devServerConfig = null == (_modernjsConfig_tools = modernjsConfig.tools) ? void 0 : _modernjsConfig_tools.devServer;
|
|
289
|
+
const corsWarnMsgs = [
|
|
290
|
+
'View https://module-federation.io/guide/troubleshooting/other.html#cors-warn for more details.'
|
|
291
|
+
];
|
|
292
|
+
if ('object' != typeof devServerConfig || !('headers' in devServerConfig)) corsWarnMsgs.unshift('Detect devServer.headers is empty, mf modern plugin will add default cors header: devServer.headers["Access-Control-Allow-Headers"] = "*". It is recommended to specify an allowlist of trusted origins instead.');
|
|
293
|
+
const exposes = null == (_userConfig_csrConfig = userConfig.csrConfig) ? void 0 : _userConfig_csrConfig.exposes;
|
|
294
|
+
const hasExposes = exposes && Array.isArray(exposes) ? exposes.length : Object.keys(null != exposes ? exposes : {}).length;
|
|
295
|
+
if (corsWarnMsgs.length > 1 && hasExposes) external_logger_js_default().warn(corsWarnMsgs.join('\n'));
|
|
296
|
+
const corsHeaders = hasExposes ? {
|
|
297
|
+
'Access-Control-Allow-Origin': '*',
|
|
298
|
+
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
|
|
299
|
+
'Access-Control-Allow-Headers': '*'
|
|
300
|
+
} : void 0;
|
|
301
|
+
return {
|
|
302
|
+
tools: {
|
|
303
|
+
devServer: {
|
|
304
|
+
headers: corsHeaders
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
resolve: {
|
|
308
|
+
alias: {
|
|
309
|
+
'@modern-js/runtime/mf': require.resolve('@module-federation/modern-js/runtime')
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
source: {
|
|
313
|
+
enableAsyncEntry: 'rspack' === bundlerType ? null != (_ref = null == (_modernjsConfig_source = modernjsConfig.source) ? void 0 : _modernjsConfig_source.enableAsyncEntry) ? _ref : true : null == (_modernjsConfig_source1 = modernjsConfig.source) ? void 0 : _modernjsConfig_source1.enableAsyncEntry
|
|
314
|
+
},
|
|
315
|
+
dev: {
|
|
316
|
+
assetPrefix: (null == modernjsConfig ? void 0 : null == (_modernjsConfig_dev = modernjsConfig.dev) ? void 0 : _modernjsConfig_dev.assetPrefix) ? modernjsConfig.dev.assetPrefix : true
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
const configPlugin = moduleFederationConfigPlugin;
|
|
323
|
+
})();
|
|
324
|
+
exports.addMyTypes2Ignored = __webpack_exports__.addMyTypes2Ignored;
|
|
325
|
+
exports["default"] = __webpack_exports__["default"];
|
|
326
|
+
exports.getMFConfig = __webpack_exports__.getMFConfig;
|
|
327
|
+
exports.isWebTarget = __webpack_exports__.isWebTarget;
|
|
328
|
+
exports.moduleFederationConfigPlugin = __webpack_exports__.moduleFederationConfigPlugin;
|
|
329
|
+
exports.patchBundlerConfig = __webpack_exports__.patchBundlerConfig;
|
|
330
|
+
exports.patchMFConfig = __webpack_exports__.patchMFConfig;
|
|
331
|
+
exports.setEnv = __webpack_exports__.setEnv;
|
|
332
|
+
exports.skipByTarget = __webpack_exports__.skipByTarget;
|
|
333
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
334
|
+
"addMyTypes2Ignored",
|
|
335
|
+
"default",
|
|
336
|
+
"getMFConfig",
|
|
337
|
+
"isWebTarget",
|
|
338
|
+
"moduleFederationConfigPlugin",
|
|
339
|
+
"patchBundlerConfig",
|
|
340
|
+
"patchMFConfig",
|
|
341
|
+
"setEnv",
|
|
342
|
+
"skipByTarget"
|
|
343
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
344
|
+
Object.defineProperty(exports, '__esModule', {
|
|
345
|
+
value: true
|
|
346
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
moduleFederationPlugin: ()=>moduleFederationPlugin,
|
|
28
|
+
createModuleFederationConfig: ()=>enhanced_namespaceObject.createModuleFederationConfig,
|
|
29
|
+
default: ()=>cli
|
|
30
|
+
});
|
|
31
|
+
const enhanced_namespaceObject = require("@module-federation/enhanced");
|
|
32
|
+
const rspack_namespaceObject = require("@module-federation/enhanced/rspack");
|
|
33
|
+
const external_configPlugin_js_namespaceObject = require("./configPlugin.js");
|
|
34
|
+
const external_ssrPlugin_js_namespaceObject = require("./ssrPlugin.js");
|
|
35
|
+
const external_utils_js_namespaceObject = require("./utils.js");
|
|
36
|
+
const moduleFederationPlugin = (userConfig = {})=>{
|
|
37
|
+
var _userConfig_fetchServerQuery, _userConfig_secondarySharedTreeShaking;
|
|
38
|
+
const internalModernPluginOptions = {
|
|
39
|
+
csrConfig: void 0,
|
|
40
|
+
ssrConfig: void 0,
|
|
41
|
+
browserPlugin: void 0,
|
|
42
|
+
nodePlugin: void 0,
|
|
43
|
+
assetResources: {},
|
|
44
|
+
distOutputDir: '',
|
|
45
|
+
originPluginOptions: {
|
|
46
|
+
...userConfig
|
|
47
|
+
},
|
|
48
|
+
userConfig: userConfig || {},
|
|
49
|
+
assetFileNames: {},
|
|
50
|
+
fetchServerQuery: null != (_userConfig_fetchServerQuery = userConfig.fetchServerQuery) ? _userConfig_fetchServerQuery : void 0,
|
|
51
|
+
secondarySharedTreeShaking: null != (_userConfig_secondarySharedTreeShaking = userConfig.secondarySharedTreeShaking) ? _userConfig_secondarySharedTreeShaking : false
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
name: '@modern-js/plugin-module-federation',
|
|
55
|
+
setup: async (api)=>{
|
|
56
|
+
const modernjsConfig = api.getConfig();
|
|
57
|
+
api.modifyBundlerChain((chain)=>{
|
|
58
|
+
const bundlerType = 'rspack' === api.getAppContext().bundlerType ? 'rspack' : 'webpack';
|
|
59
|
+
const browserPluginOptions = internalModernPluginOptions.csrConfig;
|
|
60
|
+
const { secondarySharedTreeShaking } = internalModernPluginOptions;
|
|
61
|
+
const MFPlugin = 'webpack' === bundlerType ? enhanced_namespaceObject.ModuleFederationPlugin : rspack_namespaceObject.ModuleFederationPlugin;
|
|
62
|
+
const TreeShakingSharedPlugin = 'webpack' === bundlerType ? enhanced_namespaceObject.TreeShakingSharedPlugin : rspack_namespaceObject.TreeShakingSharedPlugin;
|
|
63
|
+
if ((0, external_utils_js_namespaceObject.isWebTarget)(chain.get('target'))) if (secondarySharedTreeShaking) chain.plugin('plugin-module-federation').use(TreeShakingSharedPlugin, [
|
|
64
|
+
{
|
|
65
|
+
mfConfig: browserPluginOptions,
|
|
66
|
+
secondary: true
|
|
67
|
+
}
|
|
68
|
+
]);
|
|
69
|
+
else chain.plugin('plugin-module-federation').use(MFPlugin, [
|
|
70
|
+
browserPluginOptions
|
|
71
|
+
]).init((Plugin, args)=>{
|
|
72
|
+
internalModernPluginOptions.browserPlugin = new Plugin(args[0]);
|
|
73
|
+
return internalModernPluginOptions.browserPlugin;
|
|
74
|
+
});
|
|
75
|
+
if ('webpack' === bundlerType && !secondarySharedTreeShaking) {
|
|
76
|
+
var _modernjsConfig_source;
|
|
77
|
+
const enableAsyncEntry = null == (_modernjsConfig_source = modernjsConfig.source) ? void 0 : _modernjsConfig_source.enableAsyncEntry;
|
|
78
|
+
if (!enableAsyncEntry && false !== browserPluginOptions.async) {
|
|
79
|
+
const asyncBoundaryPluginOptions = 'object' == typeof browserPluginOptions.async ? browserPluginOptions.async : {
|
|
80
|
+
eager: (module)=>module && /\.federation/.test((null == module ? void 0 : module.request) || ''),
|
|
81
|
+
excludeChunk: (chunk)=>chunk.name === browserPluginOptions.name
|
|
82
|
+
};
|
|
83
|
+
chain.plugin('async-boundary-plugin').use(enhanced_namespaceObject.AsyncBoundaryPlugin, [
|
|
84
|
+
asyncBoundaryPluginOptions
|
|
85
|
+
]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
api._internalServerPlugins(({ plugins })=>{
|
|
90
|
+
plugins.push({
|
|
91
|
+
name: '@module-federation/modern-js/server'
|
|
92
|
+
});
|
|
93
|
+
return {
|
|
94
|
+
plugins
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
usePlugins: [
|
|
99
|
+
(0, external_configPlugin_js_namespaceObject.moduleFederationConfigPlugin)(internalModernPluginOptions),
|
|
100
|
+
(0, external_ssrPlugin_js_namespaceObject.moduleFederationSSRPlugin)(internalModernPluginOptions)
|
|
101
|
+
]
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const cli = moduleFederationPlugin;
|
|
105
|
+
exports.createModuleFederationConfig = __webpack_exports__.createModuleFederationConfig;
|
|
106
|
+
exports["default"] = __webpack_exports__["default"];
|
|
107
|
+
exports.moduleFederationPlugin = __webpack_exports__.moduleFederationPlugin;
|
|
108
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
109
|
+
"createModuleFederationConfig",
|
|
110
|
+
"default",
|
|
111
|
+
"moduleFederationPlugin"
|
|
112
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
113
|
+
Object.defineProperty(exports, '__esModule', {
|
|
114
|
+
value: true
|
|
115
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
default: ()=>inject_node_fetch
|
|
37
|
+
});
|
|
38
|
+
const external_node_fetch_namespaceObject = require("node-fetch");
|
|
39
|
+
var external_node_fetch_default = /*#__PURE__*/ __webpack_require__.n(external_node_fetch_namespaceObject);
|
|
40
|
+
const injectNodeFetchPlugin = ()=>({
|
|
41
|
+
name: 'inject-node-fetch-plugin',
|
|
42
|
+
beforeInit (args) {
|
|
43
|
+
if (!globalThis.fetch) globalThis.fetch = external_node_fetch_default();
|
|
44
|
+
return args;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const inject_node_fetch = injectNodeFetchPlugin;
|
|
48
|
+
exports["default"] = __webpack_exports__["default"];
|
|
49
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
50
|
+
"default"
|
|
51
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
52
|
+
Object.defineProperty(exports, '__esModule', {
|
|
53
|
+
value: true
|
|
54
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
default: ()=>__rspack_default_export
|
|
28
|
+
});
|
|
29
|
+
const sharedStrategy = ()=>({
|
|
30
|
+
name: 'shared-strategy-plugin',
|
|
31
|
+
beforeInit (args) {
|
|
32
|
+
const { userOptions } = args;
|
|
33
|
+
const shared = userOptions.shared;
|
|
34
|
+
if (shared) Object.keys(shared).forEach((sharedKey)=>{
|
|
35
|
+
const sharedConfigs = shared[sharedKey];
|
|
36
|
+
const arraySharedConfigs = Array.isArray(sharedConfigs) ? sharedConfigs : [
|
|
37
|
+
sharedConfigs
|
|
38
|
+
];
|
|
39
|
+
arraySharedConfigs.forEach((s)=>{
|
|
40
|
+
s.strategy = 'loaded-first';
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
return args;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const __rspack_default_export = sharedStrategy;
|
|
47
|
+
exports["default"] = __webpack_exports__["default"];
|
|
48
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
49
|
+
"default"
|
|
50
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
51
|
+
Object.defineProperty(exports, '__esModule', {
|
|
52
|
+
value: true
|
|
53
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
default: ()=>data_fetch_server_plugin
|
|
37
|
+
});
|
|
38
|
+
const data_fetch_server_middleware_namespaceObject = require("@module-federation/bridge-react/data-fetch-server-middleware");
|
|
39
|
+
var data_fetch_server_middleware_default = /*#__PURE__*/ __webpack_require__.n(data_fetch_server_middleware_namespaceObject);
|
|
40
|
+
const dataFetchServePlugin = ()=>({
|
|
41
|
+
name: 'mf-data-fetch-server-plugin',
|
|
42
|
+
setup: (api)=>{
|
|
43
|
+
api.onPrepare(()=>{
|
|
44
|
+
const { middlewares } = api.getServerContext();
|
|
45
|
+
middlewares.push({
|
|
46
|
+
name: 'module-federation-serve-manifest',
|
|
47
|
+
handler: data_fetch_server_middleware_default()
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const data_fetch_server_plugin = dataFetchServePlugin;
|
|
53
|
+
exports["default"] = __webpack_exports__["default"];
|
|
54
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
55
|
+
"default"
|
|
56
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
57
|
+
Object.defineProperty(exports, '__esModule', {
|
|
58
|
+
value: true
|
|
59
|
+
});
|