@module-federation/modern-js 0.6.9 → 0.6.11
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/esm/cli/index.js +2 -1
- package/dist/esm/cli/utils.js +4 -3
- package/package.json +13 -13
package/dist/esm/cli/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
+
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
2
3
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
3
4
|
import { ModuleFederationPlugin as WebpackModuleFederationPlugin, AsyncBoundaryPlugin } from "@module-federation/enhanced";
|
|
4
5
|
import { ModuleFederationPlugin as RspackModuleFederationPlugin } from "@module-federation/enhanced/rspack";
|
|
@@ -53,7 +54,7 @@ var moduleFederationPlugin = function() {
|
|
|
53
54
|
var enableAsyncEntry = (_modernjsConfig_source = modernjsConfig.source) === null || _modernjsConfig_source === void 0 ? void 0 : _modernjsConfig_source.enableAsyncEntry;
|
|
54
55
|
if (!enableAsyncEntry && browserPluginOptions.async !== false) {
|
|
55
56
|
var _config_plugins1;
|
|
56
|
-
var asyncBoundaryPluginOptions =
|
|
57
|
+
var asyncBoundaryPluginOptions = _type_of(browserPluginOptions.async) === "object" ? browserPluginOptions.async : {
|
|
57
58
|
eager: function(module) {
|
|
58
59
|
return module && /\.federation/.test((module === null || module === void 0 ? void 0 : module.request) || "");
|
|
59
60
|
},
|
package/dist/esm/cli/utils.js
CHANGED
|
@@ -2,6 +2,7 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
|
2
2
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
3
3
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
4
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
5
|
+
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
5
6
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
6
7
|
import { encodeName } from "@module-federation/sdk";
|
|
7
8
|
import path from "path";
|
|
@@ -69,7 +70,7 @@ var replaceRemoteUrl = function(mfConfig, remoteIpStrategy) {
|
|
|
69
70
|
if (typeof remote === "string" && remote.includes(LOCALHOST)) {
|
|
70
71
|
remoteObject[remoteKey] = remote.replace(LOCALHOST, ipv4);
|
|
71
72
|
}
|
|
72
|
-
if (typeof remote === "object" && !Array.isArray(remote.external) && remote.external.includes(LOCALHOST)) {
|
|
73
|
+
if ((typeof remote === "undefined" ? "undefined" : _type_of(remote)) === "object" && !Array.isArray(remote.external) && remote.external.includes(LOCALHOST)) {
|
|
73
74
|
remote.external = remote.external.replace(LOCALHOST, ipv4);
|
|
74
75
|
}
|
|
75
76
|
});
|
|
@@ -197,7 +198,7 @@ function patchBundlerConfig(options) {
|
|
|
197
198
|
}
|
|
198
199
|
}
|
|
199
200
|
if (mfConfig.dts !== false) {
|
|
200
|
-
if (
|
|
201
|
+
if (_type_of(mfConfig.dts) === "object" && _type_of(mfConfig.dts.consumeTypes) === "object" && mfConfig.dts.consumeTypes.remoteTypesFolder) {
|
|
201
202
|
bundlerConfig.watchOptions.ignored.push("**/".concat(mfConfig.dts.consumeTypes.remoteTypesFolder, "/**"));
|
|
202
203
|
} else {
|
|
203
204
|
bundlerConfig.watchOptions.ignored.push("**/@mf-types/**");
|
|
@@ -218,7 +219,7 @@ function patchBundlerConfig(options) {
|
|
|
218
219
|
if (!isServer) {
|
|
219
220
|
autoDeleteSplitChunkCacheGroups(mfConfig, bundlerConfig);
|
|
220
221
|
}
|
|
221
|
-
if (!isServer && enableSSR &&
|
|
222
|
+
if (!isServer && enableSSR && _type_of((_bundlerConfig_optimization1 = bundlerConfig.optimization) === null || _bundlerConfig_optimization1 === void 0 ? void 0 : _bundlerConfig_optimization1.splitChunks) === "object" && bundlerConfig.optimization.splitChunks.cacheGroups) {
|
|
222
223
|
bundlerConfig.optimization.splitChunks.chunks = "async";
|
|
223
224
|
console.warn("".concat(PLUGIN_IDENTIFIER, ' splitChunks.chunks = async is not allowed with stream SSR mode, it will auto changed to "async"'));
|
|
224
225
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/modern-js",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/",
|
|
6
6
|
"types.d.ts",
|
|
@@ -55,24 +55,24 @@
|
|
|
55
55
|
"author": "hanric <hanric.zhang@gmail.com>",
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"dependencies": {
|
|
58
|
+
"@modern-js/node-bundle-require": "2.60.3",
|
|
59
|
+
"@modern-js/utils": "2.60.3",
|
|
58
60
|
"@swc/helpers": "0.5.12",
|
|
59
|
-
"
|
|
60
|
-
"@modern-js/node-bundle-require": "2.54.2",
|
|
61
|
+
"hoist-non-react-statics": "3.3.2",
|
|
61
62
|
"node-fetch": "~3.3.0",
|
|
62
63
|
"react-error-boundary": "4.0.13",
|
|
63
|
-
"
|
|
64
|
-
"@module-federation/
|
|
65
|
-
"@module-federation/
|
|
66
|
-
"@module-federation/node": "2.5.19"
|
|
64
|
+
"@module-federation/enhanced": "0.6.11",
|
|
65
|
+
"@module-federation/node": "2.5.21",
|
|
66
|
+
"@module-federation/sdk": "0.6.11"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
+
"@modern-js/app-tools": "2.60.3",
|
|
70
|
+
"@modern-js/core": "2.60.3",
|
|
71
|
+
"@modern-js/module-tools": "2.60.3",
|
|
72
|
+
"@modern-js/runtime": "2.60.3",
|
|
73
|
+
"@modern-js/tsconfig": "2.60.3",
|
|
69
74
|
"@types/hoist-non-react-statics": "3.3.5",
|
|
70
|
-
"@
|
|
71
|
-
"@modern-js/core": "2.57.0",
|
|
72
|
-
"@modern-js/runtime": "2.57.0",
|
|
73
|
-
"@modern-js/module-tools": "2.57.0",
|
|
74
|
-
"@modern-js/tsconfig": "2.57.0",
|
|
75
|
-
"@module-federation/manifest": "0.6.9"
|
|
75
|
+
"@module-federation/manifest": "0.6.11"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": ">=17",
|