@module-federation/modern-js 0.0.0-next-20250613163655 → 0.0.0-next-20250616091910
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/LICENSE +21 -0
- package/dist/cjs/cli/configPlugin.js +381 -0
- package/dist/cjs/cli/configPlugin.spec.js +114 -0
- package/dist/cjs/cli/index.js +95 -0
- package/dist/cjs/cli/mfRuntimePlugins/inject-node-fetch.js +44 -0
- package/dist/cjs/cli/mfRuntimePlugins/resolve-entry-ipv4.js +82 -0
- package/dist/cjs/cli/mfRuntimePlugins/shared-strategy.js +43 -0
- package/dist/cjs/cli/server/data-fetch-server-plugin.js +188 -0
- package/dist/cjs/cli/ssrPlugin.js +236 -0
- package/dist/cjs/cli/utils.js +90 -0
- package/dist/cjs/constant.js +31 -0
- package/dist/cjs/interfaces/bundler.js +16 -0
- package/dist/cjs/logger.js +27 -0
- package/dist/cjs/runtime/index.js +33 -0
- package/dist/cjs/server/fileCache.js +84 -0
- package/dist/cjs/server/fileCache.spec.js +28 -0
- package/dist/cjs/server/index.js +58 -0
- package/dist/cjs/server/staticMiddleware.js +77 -0
- package/dist/cjs/server/staticMiddleware.spec.js +185 -0
- package/dist/cjs/ssr-runtime/SSRLiveReload.js +43 -0
- package/dist/cjs/ssr-runtime/devPlugin.js +71 -0
- package/dist/cjs/ssr-runtime/injectDataFetchFunctionPlugin.js +41 -0
- package/dist/cjs/types/index.js +16 -0
- package/dist/esm/cli/configPlugin.js +388 -0
- package/dist/esm/cli/configPlugin.spec.js +110 -0
- package/dist/esm/cli/index.js +90 -0
- package/dist/esm/cli/mfRuntimePlugins/inject-node-fetch.js +16 -0
- package/dist/esm/cli/mfRuntimePlugins/resolve-entry-ipv4.js +74 -0
- package/dist/esm/cli/mfRuntimePlugins/shared-strategy.js +25 -0
- package/dist/esm/cli/server/data-fetch-server-plugin.js +236 -0
- package/dist/esm/cli/ssrPlugin.js +219 -0
- package/dist/esm/cli/utils.js +53 -0
- package/dist/esm/constant.js +6 -0
- package/dist/esm/interfaces/bundler.js +0 -0
- package/dist/esm/logger.js +7 -0
- package/dist/esm/runtime/index.js +6 -0
- package/dist/esm/server/fileCache.js +98 -0
- package/dist/esm/server/fileCache.spec.js +50 -0
- package/dist/esm/server/index.js +36 -0
- package/dist/esm/server/staticMiddleware.js +81 -0
- package/dist/esm/server/staticMiddleware.spec.js +328 -0
- package/dist/esm/ssr-runtime/SSRLiveReload.js +26 -0
- package/dist/esm/ssr-runtime/devPlugin.js +73 -0
- package/dist/esm/ssr-runtime/injectDataFetchFunctionPlugin.js +35 -0
- package/dist/esm/types/index.js +0 -0
- package/dist/esm-node/cli/configPlugin.js +340 -0
- package/dist/esm-node/cli/configPlugin.spec.js +91 -0
- package/dist/esm-node/cli/index.js +70 -0
- package/dist/esm-node/cli/mfRuntimePlugins/inject-node-fetch.js +14 -0
- package/dist/esm-node/cli/mfRuntimePlugins/resolve-entry-ipv4.js +62 -0
- package/dist/esm-node/cli/mfRuntimePlugins/shared-strategy.js +23 -0
- package/dist/esm-node/cli/server/data-fetch-server-plugin.js +158 -0
- package/dist/esm-node/cli/ssrPlugin.js +200 -0
- package/dist/esm-node/cli/utils.js +53 -0
- package/dist/esm-node/constant.js +6 -0
- package/dist/esm-node/interfaces/bundler.js +0 -0
- package/dist/esm-node/logger.js +7 -0
- package/dist/esm-node/runtime/index.js +6 -0
- package/dist/esm-node/server/fileCache.js +49 -0
- package/dist/esm-node/server/fileCache.spec.js +27 -0
- package/dist/esm-node/server/index.js +34 -0
- package/dist/esm-node/server/staticMiddleware.js +43 -0
- package/dist/esm-node/server/staticMiddleware.spec.js +162 -0
- package/dist/esm-node/ssr-runtime/SSRLiveReload.js +19 -0
- package/dist/esm-node/ssr-runtime/devPlugin.js +37 -0
- package/dist/esm-node/ssr-runtime/injectDataFetchFunctionPlugin.js +17 -0
- package/dist/esm-node/types/index.js +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/resolve-entry-ipv4.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/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/runtime/index.d.ts +3 -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 +6 -0
- package/dist/types/server/staticMiddleware.spec.d.ts +1 -0
- package/dist/types/ssr-runtime/SSRLiveReload.d.ts +1 -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 +24 -0
- package/package.json +9 -16
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
3
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
|
+
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
5
|
+
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
6
|
+
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
7
|
+
import path from "path";
|
|
8
|
+
import { getIPV4, isWebTarget, skipByTarget } from "./utils";
|
|
9
|
+
import { encodeName } from "@module-federation/sdk";
|
|
10
|
+
import { bundle } from "@modern-js/node-bundle-require";
|
|
11
|
+
import { LOCALHOST, PLUGIN_IDENTIFIER } from "../constant";
|
|
12
|
+
import { autoDeleteSplitChunkCacheGroups, addDataFetchExposes } from "@module-federation/rsbuild-plugin/utils";
|
|
13
|
+
import logger from "../logger";
|
|
14
|
+
import { isDev } from "./utils";
|
|
15
|
+
var defaultPath = path.resolve(process.cwd(), "module-federation.config.ts");
|
|
16
|
+
function setEnv(enableSSR) {
|
|
17
|
+
if (enableSSR) {
|
|
18
|
+
process.env["MF_DISABLE_EMIT_STATS"] = "true";
|
|
19
|
+
process.env["MF_SSR_PRJ"] = "true";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
var getMFConfig = function() {
|
|
23
|
+
var _ref = _async_to_generator(function(userConfig) {
|
|
24
|
+
var config, configPath, mfConfigPath, preBundlePath, mfConfig;
|
|
25
|
+
return _ts_generator(this, function(_state) {
|
|
26
|
+
switch (_state.label) {
|
|
27
|
+
case 0:
|
|
28
|
+
config = userConfig.config, configPath = userConfig.configPath;
|
|
29
|
+
if (config) {
|
|
30
|
+
return [
|
|
31
|
+
2,
|
|
32
|
+
config
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
mfConfigPath = configPath ? configPath : defaultPath;
|
|
36
|
+
return [
|
|
37
|
+
4,
|
|
38
|
+
bundle(mfConfigPath)
|
|
39
|
+
];
|
|
40
|
+
case 1:
|
|
41
|
+
preBundlePath = _state.sent();
|
|
42
|
+
return [
|
|
43
|
+
4,
|
|
44
|
+
import(preBundlePath)
|
|
45
|
+
];
|
|
46
|
+
case 2:
|
|
47
|
+
mfConfig = _state.sent().default;
|
|
48
|
+
return [
|
|
49
|
+
2,
|
|
50
|
+
mfConfig
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
return function getMFConfig2(userConfig) {
|
|
56
|
+
return _ref.apply(this, arguments);
|
|
57
|
+
};
|
|
58
|
+
}();
|
|
59
|
+
var injectRuntimePlugins = function(runtimePlugin, runtimePlugins) {
|
|
60
|
+
if (!runtimePlugins.includes(runtimePlugin)) {
|
|
61
|
+
runtimePlugins.push(runtimePlugin);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var replaceRemoteUrl = function(mfConfig, remoteIpStrategy) {
|
|
65
|
+
if (remoteIpStrategy && remoteIpStrategy === "inherit") {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (!mfConfig.remotes) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
var ipv4 = getIPV4();
|
|
72
|
+
var handleRemoteObject = function(remoteObject) {
|
|
73
|
+
Object.keys(remoteObject).forEach(function(remoteKey) {
|
|
74
|
+
var remote = remoteObject[remoteKey];
|
|
75
|
+
if (Array.isArray(remote)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (typeof remote === "string" && remote.includes(LOCALHOST)) {
|
|
79
|
+
remoteObject[remoteKey] = remote.replace(LOCALHOST, ipv4);
|
|
80
|
+
}
|
|
81
|
+
if ((typeof remote === "undefined" ? "undefined" : _type_of(remote)) === "object" && !Array.isArray(remote.external) && remote.external.includes(LOCALHOST)) {
|
|
82
|
+
remote.external = remote.external.replace(LOCALHOST, ipv4);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
if (Array.isArray(mfConfig.remotes)) {
|
|
87
|
+
mfConfig.remotes.forEach(function(remoteObject) {
|
|
88
|
+
if (typeof remoteObject === "string") {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
handleRemoteObject(remoteObject);
|
|
92
|
+
});
|
|
93
|
+
} else if (typeof mfConfig.remotes !== "string") {
|
|
94
|
+
handleRemoteObject(mfConfig.remotes);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
var patchDTSConfig = function(mfConfig, isServer) {
|
|
98
|
+
if (isServer) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
var ModernJSRuntime = "@module-federation/modern-js/runtime";
|
|
102
|
+
if (mfConfig.dts !== false) {
|
|
103
|
+
var _mfConfig_dts, _mfConfig_dts1;
|
|
104
|
+
if (typeof mfConfig.dts === "boolean" || mfConfig.dts === void 0) {
|
|
105
|
+
mfConfig.dts = {
|
|
106
|
+
consumeTypes: {
|
|
107
|
+
runtimePkgs: [
|
|
108
|
+
ModernJSRuntime
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
} else if (((_mfConfig_dts = mfConfig.dts) === null || _mfConfig_dts === void 0 ? void 0 : _mfConfig_dts.consumeTypes) || ((_mfConfig_dts1 = mfConfig.dts) === null || _mfConfig_dts1 === void 0 ? void 0 : _mfConfig_dts1.consumeTypes) === void 0) {
|
|
113
|
+
var _mfConfig_dts2;
|
|
114
|
+
if (typeof mfConfig.dts.consumeTypes === "boolean" || ((_mfConfig_dts2 = mfConfig.dts) === null || _mfConfig_dts2 === void 0 ? void 0 : _mfConfig_dts2.consumeTypes) === void 0) {
|
|
115
|
+
mfConfig.dts.consumeTypes = {
|
|
116
|
+
runtimePkgs: [
|
|
117
|
+
ModernJSRuntime
|
|
118
|
+
]
|
|
119
|
+
};
|
|
120
|
+
} else {
|
|
121
|
+
mfConfig.dts.consumeTypes.runtimePkgs = mfConfig.dts.consumeTypes.runtimePkgs || [];
|
|
122
|
+
if (!mfConfig.dts.consumeTypes.runtimePkgs.includes(ModernJSRuntime)) {
|
|
123
|
+
mfConfig.dts.consumeTypes.runtimePkgs.push(ModernJSRuntime);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
var patchMFConfig = function(mfConfig, isServer, remoteIpStrategy, enableSSR) {
|
|
130
|
+
replaceRemoteUrl(mfConfig, remoteIpStrategy);
|
|
131
|
+
addDataFetchExposes(mfConfig.exposes, isServer);
|
|
132
|
+
if (mfConfig.remoteType === void 0) {
|
|
133
|
+
mfConfig.remoteType = "script";
|
|
134
|
+
}
|
|
135
|
+
if (!mfConfig.name) {
|
|
136
|
+
throw new Error("".concat(PLUGIN_IDENTIFIER, " mfConfig.name can not be empty!"));
|
|
137
|
+
}
|
|
138
|
+
var runtimePlugins = _to_consumable_array(mfConfig.runtimePlugins || []);
|
|
139
|
+
patchDTSConfig(mfConfig, isServer);
|
|
140
|
+
injectRuntimePlugins(require.resolve("@module-federation/modern-js/shared-strategy"), runtimePlugins);
|
|
141
|
+
injectRuntimePlugins(require.resolve("@module-federation/bridge-react/data-fetch-runtime-plugin"), runtimePlugins);
|
|
142
|
+
if (enableSSR && isDev()) {
|
|
143
|
+
injectRuntimePlugins(require.resolve("@module-federation/modern-js/resolve-entry-ipv4"), runtimePlugins);
|
|
144
|
+
}
|
|
145
|
+
if (isServer) {
|
|
146
|
+
injectRuntimePlugins(require.resolve("@module-federation/node/runtimePlugin"), runtimePlugins);
|
|
147
|
+
if (isDev()) {
|
|
148
|
+
injectRuntimePlugins(require.resolve("@module-federation/node/record-dynamic-remote-entry-hash-plugin"), runtimePlugins);
|
|
149
|
+
}
|
|
150
|
+
injectRuntimePlugins(require.resolve("@module-federation/modern-js/inject-node-fetch"), runtimePlugins);
|
|
151
|
+
if (!mfConfig.library) {
|
|
152
|
+
mfConfig.library = {
|
|
153
|
+
type: "commonjs-module",
|
|
154
|
+
name: mfConfig.name
|
|
155
|
+
};
|
|
156
|
+
} else {
|
|
157
|
+
if (!mfConfig.library.type) {
|
|
158
|
+
mfConfig.library.type = "commonjs-module";
|
|
159
|
+
}
|
|
160
|
+
if (!mfConfig.library.name) {
|
|
161
|
+
mfConfig.library.name = mfConfig.name;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
mfConfig.runtimePlugins = runtimePlugins;
|
|
166
|
+
if (!isServer) {
|
|
167
|
+
var _mfConfig_library;
|
|
168
|
+
if (((_mfConfig_library = mfConfig.library) === null || _mfConfig_library === void 0 ? void 0 : _mfConfig_library.type) === "commonjs-module") {
|
|
169
|
+
mfConfig.library.type = "global";
|
|
170
|
+
}
|
|
171
|
+
return mfConfig;
|
|
172
|
+
}
|
|
173
|
+
mfConfig.dts = false;
|
|
174
|
+
mfConfig.dev = false;
|
|
175
|
+
return mfConfig;
|
|
176
|
+
};
|
|
177
|
+
function patchIgnoreWarning(chain) {
|
|
178
|
+
var ignoreWarnings = chain.get("ignoreWarnings") || [];
|
|
179
|
+
var ignoredMsgs = [
|
|
180
|
+
"external script",
|
|
181
|
+
"process.env.WS_NO_BUFFER_UTIL",
|
|
182
|
+
"Can't resolve 'utf-8-validate"
|
|
183
|
+
];
|
|
184
|
+
ignoreWarnings.push(function(warning) {
|
|
185
|
+
if (ignoredMsgs.some(function(msg) {
|
|
186
|
+
return warning.message.includes(msg);
|
|
187
|
+
})) {
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
return false;
|
|
191
|
+
});
|
|
192
|
+
chain.ignoreWarnings(ignoreWarnings);
|
|
193
|
+
}
|
|
194
|
+
function addMyTypes2Ignored(chain, mfConfig) {
|
|
195
|
+
var watchOptions = chain.get("watchOptions");
|
|
196
|
+
if (!watchOptions || !watchOptions.ignored) {
|
|
197
|
+
chain.watchOptions({
|
|
198
|
+
ignored: /[\\/](?:\.git|node_modules|@mf-types)[\\/]/
|
|
199
|
+
});
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
var ignored = watchOptions.ignored;
|
|
203
|
+
var DEFAULT_IGNORED_GLOB = "**/@mf-types/**";
|
|
204
|
+
if (Array.isArray(ignored)) {
|
|
205
|
+
if (mfConfig.dts !== false && _type_of(mfConfig.dts) === "object" && _type_of(mfConfig.dts.consumeTypes) === "object" && mfConfig.dts.consumeTypes.remoteTypesFolder) {
|
|
206
|
+
chain.watchOptions(_object_spread_props(_object_spread({}, watchOptions), {
|
|
207
|
+
ignored: ignored.concat("**/".concat(mfConfig.dts.consumeTypes.remoteTypesFolder, "/**"))
|
|
208
|
+
}));
|
|
209
|
+
} else {
|
|
210
|
+
chain.watchOptions(_object_spread_props(_object_spread({}, watchOptions), {
|
|
211
|
+
ignored: ignored.concat(DEFAULT_IGNORED_GLOB)
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (typeof ignored !== "string") {
|
|
217
|
+
chain.watchOptions(_object_spread_props(_object_spread({}, watchOptions), {
|
|
218
|
+
ignored: /[\\/](?:\.git|node_modules|@mf-types)[\\/]/
|
|
219
|
+
}));
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
chain.watchOptions(_object_spread_props(_object_spread({}, watchOptions), {
|
|
223
|
+
ignored: ignored.concat(DEFAULT_IGNORED_GLOB)
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
226
|
+
function patchBundlerConfig(options) {
|
|
227
|
+
var _modernjsConfig_deploy;
|
|
228
|
+
var chain = options.chain, modernjsConfig = options.modernjsConfig, isServer = options.isServer, mfConfig = options.mfConfig, enableSSR = options.enableSSR;
|
|
229
|
+
chain.optimization.delete("runtimeChunk");
|
|
230
|
+
patchIgnoreWarning(chain);
|
|
231
|
+
if (!chain.output.get("chunkLoadingGlobal")) {
|
|
232
|
+
chain.output.chunkLoadingGlobal("chunk_".concat(mfConfig.name));
|
|
233
|
+
}
|
|
234
|
+
if (!chain.output.get("uniqueName")) {
|
|
235
|
+
chain.output.uniqueName(mfConfig.name);
|
|
236
|
+
}
|
|
237
|
+
var splitChunkConfig = chain.optimization.splitChunks.entries();
|
|
238
|
+
if (!isServer) {
|
|
239
|
+
autoDeleteSplitChunkCacheGroups(mfConfig, splitChunkConfig);
|
|
240
|
+
}
|
|
241
|
+
if (!isServer && enableSSR && splitChunkConfig && (typeof splitChunkConfig === "undefined" ? "undefined" : _type_of(splitChunkConfig)) === "object" && splitChunkConfig.cacheGroups) {
|
|
242
|
+
splitChunkConfig.chunks = "async";
|
|
243
|
+
logger.warn('splitChunks.chunks = async is not allowed with stream SSR mode, it will auto changed to "async"');
|
|
244
|
+
}
|
|
245
|
+
if (isDev() && chain.output.get("publicPath") === "auto") {
|
|
246
|
+
var _modernjsConfig_dev, _modernjsConfig_server;
|
|
247
|
+
var port = ((_modernjsConfig_dev = modernjsConfig.dev) === null || _modernjsConfig_dev === void 0 ? void 0 : _modernjsConfig_dev.port) || ((_modernjsConfig_server = modernjsConfig.server) === null || _modernjsConfig_server === void 0 ? void 0 : _modernjsConfig_server.port) || 8080;
|
|
248
|
+
var publicPath = "http://localhost:".concat(port, "/");
|
|
249
|
+
chain.output.publicPath(publicPath);
|
|
250
|
+
}
|
|
251
|
+
if (isServer && enableSSR) {
|
|
252
|
+
var uniqueName = mfConfig.name || chain.output.get("uniqueName");
|
|
253
|
+
var chunkFileName = chain.output.get("chunkFilename");
|
|
254
|
+
if (typeof chunkFileName === "string" && uniqueName && !chunkFileName.includes(uniqueName)) {
|
|
255
|
+
var suffix = "".concat(encodeName(uniqueName), "-[chunkhash].js");
|
|
256
|
+
chain.output.chunkFilename(chunkFileName.replace(".js", suffix));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (isDev() && enableSSR && !isServer) {
|
|
260
|
+
chain.resolve.fallback.set("crypto", false).set("stream", false).set("vm", false);
|
|
261
|
+
}
|
|
262
|
+
if (((_modernjsConfig_deploy = modernjsConfig.deploy) === null || _modernjsConfig_deploy === void 0 ? void 0 : _modernjsConfig_deploy.microFrontend) && Object.keys(mfConfig.exposes || {}).length) {
|
|
263
|
+
chain.optimization.usedExports(false);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
var moduleFederationConfigPlugin = function(userConfig) {
|
|
267
|
+
return {
|
|
268
|
+
name: "@modern-js/plugin-module-federation-config",
|
|
269
|
+
pre: [
|
|
270
|
+
"@modern-js/plugin-initialize"
|
|
271
|
+
],
|
|
272
|
+
post: [
|
|
273
|
+
"@modern-js/plugin-module-federation"
|
|
274
|
+
],
|
|
275
|
+
setup: function() {
|
|
276
|
+
var _ref = _async_to_generator(function(api) {
|
|
277
|
+
var _userConfig_userConfig, _modernjsConfig_server, modernjsConfig, mfConfig, csrConfig, ssrConfig, _userConfig_userConfig_ssr, enableSSR;
|
|
278
|
+
return _ts_generator(this, function(_state) {
|
|
279
|
+
switch (_state.label) {
|
|
280
|
+
case 0:
|
|
281
|
+
modernjsConfig = api.getConfig();
|
|
282
|
+
return [
|
|
283
|
+
4,
|
|
284
|
+
getMFConfig(userConfig.originPluginOptions)
|
|
285
|
+
];
|
|
286
|
+
case 1:
|
|
287
|
+
mfConfig = _state.sent();
|
|
288
|
+
csrConfig = userConfig.csrConfig || JSON.parse(JSON.stringify(mfConfig));
|
|
289
|
+
ssrConfig = userConfig.ssrConfig || JSON.parse(JSON.stringify(mfConfig));
|
|
290
|
+
userConfig.ssrConfig = ssrConfig;
|
|
291
|
+
userConfig.csrConfig = csrConfig;
|
|
292
|
+
enableSSR = Boolean((_userConfig_userConfig_ssr = (_userConfig_userConfig = userConfig.userConfig) === null || _userConfig_userConfig === void 0 ? void 0 : _userConfig_userConfig.ssr) !== null && _userConfig_userConfig_ssr !== void 0 ? _userConfig_userConfig_ssr : Boolean(modernjsConfig === null || modernjsConfig === void 0 ? void 0 : (_modernjsConfig_server = modernjsConfig.server) === null || _modernjsConfig_server === void 0 ? void 0 : _modernjsConfig_server.ssr));
|
|
293
|
+
api.modifyBundlerChain(function(chain) {
|
|
294
|
+
var target = chain.get("target");
|
|
295
|
+
if (skipByTarget(target)) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
var isWeb = isWebTarget(target);
|
|
299
|
+
addMyTypes2Ignored(chain, !isWeb ? ssrConfig : csrConfig);
|
|
300
|
+
var targetMFConfig = !isWeb ? ssrConfig : csrConfig;
|
|
301
|
+
patchMFConfig(targetMFConfig, !isWeb, userConfig.remoteIpStrategy || "ipv4", enableSSR);
|
|
302
|
+
patchBundlerConfig({
|
|
303
|
+
chain,
|
|
304
|
+
isServer: !isWeb,
|
|
305
|
+
modernjsConfig,
|
|
306
|
+
mfConfig,
|
|
307
|
+
enableSSR
|
|
308
|
+
});
|
|
309
|
+
userConfig.distOutputDir = chain.output.get("path") || path.resolve(process.cwd(), "dist");
|
|
310
|
+
});
|
|
311
|
+
api.config(function() {
|
|
312
|
+
var _modernjsConfig_tools, _userConfig_csrConfig, _modernjsConfig_source, _modernjsConfig_source1, _modernjsConfig_dev;
|
|
313
|
+
var bundlerType = api.getAppContext().bundlerType === "rspack" ? "rspack" : "webpack";
|
|
314
|
+
var ipv4 = getIPV4();
|
|
315
|
+
if (userConfig.remoteIpStrategy === void 0) {
|
|
316
|
+
if (!enableSSR) {
|
|
317
|
+
userConfig.remoteIpStrategy = "inherit";
|
|
318
|
+
} else {
|
|
319
|
+
userConfig.remoteIpStrategy = "ipv4";
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
var devServerConfig = (_modernjsConfig_tools = modernjsConfig.tools) === null || _modernjsConfig_tools === void 0 ? void 0 : _modernjsConfig_tools.devServer;
|
|
323
|
+
var corsWarnMsgs = [
|
|
324
|
+
"View https://module-federation.io/guide/troubleshooting/other.html#cors-warn for more details."
|
|
325
|
+
];
|
|
326
|
+
if ((typeof devServerConfig === "undefined" ? "undefined" : _type_of(devServerConfig)) !== "object" || !("headers" in devServerConfig)) {
|
|
327
|
+
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.');
|
|
328
|
+
}
|
|
329
|
+
var exposes = (_userConfig_csrConfig = userConfig.csrConfig) === null || _userConfig_csrConfig === void 0 ? void 0 : _userConfig_csrConfig.exposes;
|
|
330
|
+
var hasExposes = exposes && Array.isArray(exposes) ? exposes.length : Object.keys(exposes !== null && exposes !== void 0 ? exposes : {}).length;
|
|
331
|
+
if (corsWarnMsgs.length > 1 && hasExposes) {
|
|
332
|
+
logger.warn(corsWarnMsgs.join("\n"));
|
|
333
|
+
}
|
|
334
|
+
var corsHeaders = hasExposes ? {
|
|
335
|
+
"Access-Control-Allow-Origin": "*",
|
|
336
|
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
|
337
|
+
"Access-Control-Allow-Headers": "*"
|
|
338
|
+
} : void 0;
|
|
339
|
+
var defineConfig = {
|
|
340
|
+
REMOTE_IP_STRATEGY: JSON.stringify(userConfig.remoteIpStrategy)
|
|
341
|
+
};
|
|
342
|
+
if (enableSSR && isDev()) {
|
|
343
|
+
defineConfig["FEDERATION_IPV4"] = JSON.stringify(ipv4);
|
|
344
|
+
}
|
|
345
|
+
var _modernjsConfig_source_enableAsyncEntry;
|
|
346
|
+
return {
|
|
347
|
+
tools: {
|
|
348
|
+
devServer: {
|
|
349
|
+
headers: corsHeaders
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
source: {
|
|
353
|
+
alias: {
|
|
354
|
+
// TODO: deprecated
|
|
355
|
+
"@modern-js/runtime/mf": require.resolve("@module-federation/modern-js/runtime")
|
|
356
|
+
},
|
|
357
|
+
define: defineConfig,
|
|
358
|
+
enableAsyncEntry: bundlerType === "rspack" ? (_modernjsConfig_source_enableAsyncEntry = (_modernjsConfig_source = modernjsConfig.source) === null || _modernjsConfig_source === void 0 ? void 0 : _modernjsConfig_source.enableAsyncEntry) !== null && _modernjsConfig_source_enableAsyncEntry !== void 0 ? _modernjsConfig_source_enableAsyncEntry : true : (_modernjsConfig_source1 = modernjsConfig.source) === null || _modernjsConfig_source1 === void 0 ? void 0 : _modernjsConfig_source1.enableAsyncEntry
|
|
359
|
+
},
|
|
360
|
+
dev: {
|
|
361
|
+
assetPrefix: (modernjsConfig === null || modernjsConfig === void 0 ? void 0 : (_modernjsConfig_dev = modernjsConfig.dev) === null || _modernjsConfig_dev === void 0 ? void 0 : _modernjsConfig_dev.assetPrefix) ? modernjsConfig.dev.assetPrefix : true
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
});
|
|
365
|
+
return [
|
|
366
|
+
2
|
|
367
|
+
];
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
return function(api) {
|
|
372
|
+
return _ref.apply(this, arguments);
|
|
373
|
+
};
|
|
374
|
+
}()
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
var configPlugin_default = moduleFederationConfigPlugin;
|
|
378
|
+
export {
|
|
379
|
+
addMyTypes2Ignored,
|
|
380
|
+
configPlugin_default as default,
|
|
381
|
+
getMFConfig,
|
|
382
|
+
isWebTarget,
|
|
383
|
+
moduleFederationConfigPlugin,
|
|
384
|
+
patchBundlerConfig,
|
|
385
|
+
patchMFConfig,
|
|
386
|
+
setEnv,
|
|
387
|
+
skipByTarget
|
|
388
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
+
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
3
|
+
import { it, expect, describe } from "vitest";
|
|
4
|
+
import { patchMFConfig } from "./configPlugin";
|
|
5
|
+
import { getIPV4 } from "./utils";
|
|
6
|
+
var mfConfig = {
|
|
7
|
+
name: "host",
|
|
8
|
+
filename: "remoteEntry.js",
|
|
9
|
+
remotes: {
|
|
10
|
+
remote: "http://localhost:3000/remoteEntry.js"
|
|
11
|
+
},
|
|
12
|
+
shared: {
|
|
13
|
+
react: {
|
|
14
|
+
singleton: true,
|
|
15
|
+
eager: true
|
|
16
|
+
},
|
|
17
|
+
"react-dom": {
|
|
18
|
+
singleton: true,
|
|
19
|
+
eager: true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
describe("patchMFConfig", /* @__PURE__ */ _async_to_generator(function() {
|
|
24
|
+
return _ts_generator(this, function(_state) {
|
|
25
|
+
it("patchMFConfig: server", /* @__PURE__ */ _async_to_generator(function() {
|
|
26
|
+
var patchedConfig, ipv4;
|
|
27
|
+
return _ts_generator(this, function(_state2) {
|
|
28
|
+
patchedConfig = JSON.parse(JSON.stringify(mfConfig));
|
|
29
|
+
patchMFConfig(patchedConfig, true);
|
|
30
|
+
ipv4 = getIPV4();
|
|
31
|
+
expect(patchedConfig).toStrictEqual({
|
|
32
|
+
dev: false,
|
|
33
|
+
dts: false,
|
|
34
|
+
filename: "remoteEntry.js",
|
|
35
|
+
library: {
|
|
36
|
+
name: "host",
|
|
37
|
+
type: "commonjs-module"
|
|
38
|
+
},
|
|
39
|
+
name: "host",
|
|
40
|
+
remotes: {
|
|
41
|
+
remote: "http://".concat(ipv4, ":3000/remoteEntry.js")
|
|
42
|
+
},
|
|
43
|
+
remoteType: "script",
|
|
44
|
+
runtimePlugins: [
|
|
45
|
+
require.resolve("@module-federation/modern-js/shared-strategy"),
|
|
46
|
+
require.resolve("@module-federation/bridge-react/data-fetch-runtime-plugin"),
|
|
47
|
+
require.resolve("@module-federation/node/runtimePlugin"),
|
|
48
|
+
require.resolve("@module-federation/modern-js/inject-node-fetch")
|
|
49
|
+
],
|
|
50
|
+
shared: {
|
|
51
|
+
react: {
|
|
52
|
+
eager: true,
|
|
53
|
+
singleton: true
|
|
54
|
+
},
|
|
55
|
+
"react-dom": {
|
|
56
|
+
eager: true,
|
|
57
|
+
singleton: true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return [
|
|
62
|
+
2
|
|
63
|
+
];
|
|
64
|
+
});
|
|
65
|
+
}));
|
|
66
|
+
it("patchMFConfig: client", /* @__PURE__ */ _async_to_generator(function() {
|
|
67
|
+
var patchedConfig, ipv4;
|
|
68
|
+
return _ts_generator(this, function(_state2) {
|
|
69
|
+
patchedConfig = JSON.parse(JSON.stringify(mfConfig));
|
|
70
|
+
patchMFConfig(patchedConfig, false);
|
|
71
|
+
ipv4 = getIPV4();
|
|
72
|
+
expect(patchedConfig).toStrictEqual({
|
|
73
|
+
filename: "remoteEntry.js",
|
|
74
|
+
name: "host",
|
|
75
|
+
remotes: {
|
|
76
|
+
remote: "http://".concat(ipv4, ":3000/remoteEntry.js")
|
|
77
|
+
},
|
|
78
|
+
remoteType: "script",
|
|
79
|
+
runtimePlugins: [
|
|
80
|
+
require.resolve("@module-federation/modern-js/shared-strategy"),
|
|
81
|
+
require.resolve("@module-federation/bridge-react/data-fetch-runtime-plugin")
|
|
82
|
+
],
|
|
83
|
+
shared: {
|
|
84
|
+
react: {
|
|
85
|
+
eager: true,
|
|
86
|
+
singleton: true
|
|
87
|
+
},
|
|
88
|
+
"react-dom": {
|
|
89
|
+
eager: true,
|
|
90
|
+
singleton: true
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
dts: {
|
|
94
|
+
consumeTypes: {
|
|
95
|
+
runtimePkgs: [
|
|
96
|
+
"@module-federation/modern-js/runtime"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return [
|
|
102
|
+
2
|
|
103
|
+
];
|
|
104
|
+
});
|
|
105
|
+
}));
|
|
106
|
+
return [
|
|
107
|
+
2
|
|
108
|
+
];
|
|
109
|
+
});
|
|
110
|
+
}));
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
+
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
3
|
+
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
4
|
+
import { ModuleFederationPlugin as WebpackModuleFederationPlugin, AsyncBoundaryPlugin } from "@module-federation/enhanced";
|
|
5
|
+
import { ModuleFederationPlugin as RspackModuleFederationPlugin } from "@module-federation/enhanced/rspack";
|
|
6
|
+
import { moduleFederationConfigPlugin } from "./configPlugin";
|
|
7
|
+
import { moduleFederationSSRPlugin } from "./ssrPlugin";
|
|
8
|
+
import { isWebTarget } from "./utils";
|
|
9
|
+
var moduleFederationPlugin = function() {
|
|
10
|
+
var userConfig = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
11
|
+
var _userConfig_fetchServerQuery;
|
|
12
|
+
var internalModernPluginOptions = {
|
|
13
|
+
csrConfig: void 0,
|
|
14
|
+
ssrConfig: void 0,
|
|
15
|
+
browserPlugin: void 0,
|
|
16
|
+
nodePlugin: void 0,
|
|
17
|
+
distOutputDir: "",
|
|
18
|
+
originPluginOptions: userConfig,
|
|
19
|
+
remoteIpStrategy: userConfig === null || userConfig === void 0 ? void 0 : userConfig.remoteIpStrategy,
|
|
20
|
+
userConfig: userConfig || {},
|
|
21
|
+
fetchServerQuery: (_userConfig_fetchServerQuery = userConfig.fetchServerQuery) !== null && _userConfig_fetchServerQuery !== void 0 ? _userConfig_fetchServerQuery : void 0
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
name: "@modern-js/plugin-module-federation",
|
|
25
|
+
setup: function() {
|
|
26
|
+
var _ref = _async_to_generator(function(api) {
|
|
27
|
+
var modernjsConfig;
|
|
28
|
+
return _ts_generator(this, function(_state) {
|
|
29
|
+
modernjsConfig = api.getConfig();
|
|
30
|
+
api.modifyBundlerChain(function(chain) {
|
|
31
|
+
var bundlerType = api.getAppContext().bundlerType === "rspack" ? "rspack" : "webpack";
|
|
32
|
+
var browserPluginOptions = internalModernPluginOptions.csrConfig;
|
|
33
|
+
var MFPlugin = bundlerType === "webpack" ? WebpackModuleFederationPlugin : RspackModuleFederationPlugin;
|
|
34
|
+
if (isWebTarget(chain.get("target"))) {
|
|
35
|
+
chain.plugin("plugin-module-federation").use(MFPlugin, [
|
|
36
|
+
browserPluginOptions
|
|
37
|
+
]).init(function(Plugin, args) {
|
|
38
|
+
internalModernPluginOptions.browserPlugin = new Plugin(args[0]);
|
|
39
|
+
return internalModernPluginOptions.browserPlugin;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (bundlerType === "webpack") {
|
|
43
|
+
var _modernjsConfig_source;
|
|
44
|
+
var enableAsyncEntry = (_modernjsConfig_source = modernjsConfig.source) === null || _modernjsConfig_source === void 0 ? void 0 : _modernjsConfig_source.enableAsyncEntry;
|
|
45
|
+
if (!enableAsyncEntry && browserPluginOptions.async !== false) {
|
|
46
|
+
var asyncBoundaryPluginOptions = _type_of(browserPluginOptions.async) === "object" ? browserPluginOptions.async : {
|
|
47
|
+
eager: function(module) {
|
|
48
|
+
return module && /\.federation/.test((module === null || module === void 0 ? void 0 : module.request) || "");
|
|
49
|
+
},
|
|
50
|
+
excludeChunk: function(chunk) {
|
|
51
|
+
return chunk.name === browserPluginOptions.name;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
chain.plugin("async-boundary-plugin").use(AsyncBoundaryPlugin, [
|
|
55
|
+
asyncBoundaryPluginOptions
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
api._internalServerPlugins(function(param) {
|
|
61
|
+
var plugins = param.plugins;
|
|
62
|
+
plugins.push({
|
|
63
|
+
name: "@module-federation/modern-js/server"
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
plugins
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
return [
|
|
70
|
+
2
|
|
71
|
+
];
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
return function(api) {
|
|
75
|
+
return _ref.apply(this, arguments);
|
|
76
|
+
};
|
|
77
|
+
}(),
|
|
78
|
+
usePlugins: [
|
|
79
|
+
moduleFederationConfigPlugin(internalModernPluginOptions),
|
|
80
|
+
moduleFederationSSRPlugin(internalModernPluginOptions)
|
|
81
|
+
]
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
var cli_default = moduleFederationPlugin;
|
|
85
|
+
import { createModuleFederationConfig } from "@module-federation/enhanced";
|
|
86
|
+
export {
|
|
87
|
+
createModuleFederationConfig,
|
|
88
|
+
cli_default as default,
|
|
89
|
+
moduleFederationPlugin
|
|
90
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import nodeFetch from "node-fetch";
|
|
2
|
+
var injectNodeFetchPlugin = function() {
|
|
3
|
+
return {
|
|
4
|
+
name: "inject-node-fetch-plugin",
|
|
5
|
+
beforeInit: function beforeInit(args) {
|
|
6
|
+
if (!globalThis.fetch) {
|
|
7
|
+
globalThis.fetch = nodeFetch;
|
|
8
|
+
}
|
|
9
|
+
return args;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
var inject_node_fetch_default = injectNodeFetchPlugin;
|
|
14
|
+
export {
|
|
15
|
+
inject_node_fetch_default as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
+
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
3
|
+
import { LOCALHOST } from "../../constant";
|
|
4
|
+
var ipv4 = typeof FEDERATION_IPV4 !== "undefined" ? FEDERATION_IPV4 : "127.0.0.1";
|
|
5
|
+
var remoteIpStrategy = typeof REMOTE_IP_STRATEGY !== "undefined" ? REMOTE_IP_STRATEGY : "inherit";
|
|
6
|
+
function replaceObjectLocalhost(key, obj) {
|
|
7
|
+
if (remoteIpStrategy !== "ipv4") {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (!(key in obj)) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
var remote = obj[key];
|
|
14
|
+
if (remote && typeof remote === "string" && remote.includes(LOCALHOST)) {
|
|
15
|
+
obj[key] = replaceLocalhost(remote);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function replaceLocalhost(url) {
|
|
19
|
+
return url.replace(LOCALHOST, ipv4);
|
|
20
|
+
}
|
|
21
|
+
var resolveEntryIpv4Plugin = function() {
|
|
22
|
+
return {
|
|
23
|
+
name: "resolve-entry-ipv4",
|
|
24
|
+
beforeRegisterRemote: function beforeRegisterRemote(args) {
|
|
25
|
+
var remote = args.remote;
|
|
26
|
+
replaceObjectLocalhost("entry", remote);
|
|
27
|
+
return args;
|
|
28
|
+
},
|
|
29
|
+
afterResolve: function afterResolve(args) {
|
|
30
|
+
return _async_to_generator(function() {
|
|
31
|
+
var remoteInfo;
|
|
32
|
+
return _ts_generator(this, function(_state) {
|
|
33
|
+
remoteInfo = args.remoteInfo;
|
|
34
|
+
replaceObjectLocalhost("entry", remoteInfo);
|
|
35
|
+
return [
|
|
36
|
+
2,
|
|
37
|
+
args
|
|
38
|
+
];
|
|
39
|
+
});
|
|
40
|
+
})();
|
|
41
|
+
},
|
|
42
|
+
beforeLoadRemoteSnapshot: function beforeLoadRemoteSnapshot(args) {
|
|
43
|
+
var moduleInfo = args.moduleInfo;
|
|
44
|
+
if ("entry" in moduleInfo) {
|
|
45
|
+
replaceObjectLocalhost("entry", moduleInfo);
|
|
46
|
+
return args;
|
|
47
|
+
}
|
|
48
|
+
if ("version" in moduleInfo) {
|
|
49
|
+
replaceObjectLocalhost("version", moduleInfo);
|
|
50
|
+
}
|
|
51
|
+
return args;
|
|
52
|
+
},
|
|
53
|
+
loadRemoteSnapshot: function loadRemoteSnapshot(args) {
|
|
54
|
+
var remoteSnapshot = args.remoteSnapshot;
|
|
55
|
+
if ("publicPath" in remoteSnapshot) {
|
|
56
|
+
replaceObjectLocalhost("publicPath", remoteSnapshot);
|
|
57
|
+
}
|
|
58
|
+
if ("getPublicPath" in remoteSnapshot) {
|
|
59
|
+
replaceObjectLocalhost("getPublicPath", remoteSnapshot);
|
|
60
|
+
}
|
|
61
|
+
if (remoteSnapshot.remotesInfo) {
|
|
62
|
+
Object.keys(remoteSnapshot.remotesInfo).forEach(function(key) {
|
|
63
|
+
var remoteInfo = remoteSnapshot.remotesInfo[key];
|
|
64
|
+
replaceObjectLocalhost("matchedVersion", remoteInfo);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return args;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
var resolve_entry_ipv4_default = resolveEntryIpv4Plugin;
|
|
72
|
+
export {
|
|
73
|
+
resolve_entry_ipv4_default as default
|
|
74
|
+
};
|