@module-federation/modern-js 0.6.1 → 0.6.3
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/cjs/cli/configPlugin.js +7 -2
- package/dist/cjs/cli/ssrPlugin.js +0 -6
- package/dist/cjs/cli/utils.js +2 -2
- package/dist/esm/cli/configPlugin.js +6 -2
- package/dist/esm/cli/ssrPlugin.js +0 -5
- package/dist/esm/cli/utils.js +2 -2
- package/dist/esm-node/cli/configPlugin.js +7 -2
- package/dist/esm-node/cli/ssrPlugin.js +0 -6
- package/dist/esm-node/cli/utils.js +2 -2
- package/package.json +5 -5
|
@@ -55,6 +55,9 @@ function modifyBundlerConfig(options) {
|
|
|
55
55
|
}
|
|
56
56
|
const moduleFederationConfigPlugin = (userConfig) => ({
|
|
57
57
|
name: "@modern-js/plugin-module-federation-config",
|
|
58
|
+
pre: [
|
|
59
|
+
"@modern-js/plugin-initialize"
|
|
60
|
+
],
|
|
58
61
|
post: [
|
|
59
62
|
"@modern-js/plugin-module-federation"
|
|
60
63
|
],
|
|
@@ -67,7 +70,7 @@ const moduleFederationConfigPlugin = (userConfig) => ({
|
|
|
67
70
|
userConfig.csrConfig = csrConfig;
|
|
68
71
|
return {
|
|
69
72
|
config: async () => {
|
|
70
|
-
var _modernjsConfig_server, _modernjsConfig_dev;
|
|
73
|
+
var _modernjsConfig_server, _modernjsConfig_source, _modernjsConfig_source1, _modernjsConfig_dev;
|
|
71
74
|
const bundlerType = useAppContext().bundlerType === "rspack" ? "rspack" : "webpack";
|
|
72
75
|
const ipv4 = (0, import_utils.getIPV4)();
|
|
73
76
|
const enableSSR = Boolean(modernjsConfig === null || modernjsConfig === void 0 ? void 0 : (_modernjsConfig_server = modernjsConfig.server) === null || _modernjsConfig_server === void 0 ? void 0 : _modernjsConfig_server.ssr);
|
|
@@ -78,6 +81,7 @@ const moduleFederationConfigPlugin = (userConfig) => ({
|
|
|
78
81
|
userConfig.remoteIpStrategy = "ipv4";
|
|
79
82
|
}
|
|
80
83
|
}
|
|
84
|
+
var _modernjsConfig_source_enableAsyncEntry;
|
|
81
85
|
return {
|
|
82
86
|
tools: {
|
|
83
87
|
rspack(config, { isServer }) {
|
|
@@ -119,7 +123,8 @@ const moduleFederationConfigPlugin = (userConfig) => ({
|
|
|
119
123
|
define: {
|
|
120
124
|
FEDERATION_IPV4: JSON.stringify(ipv4),
|
|
121
125
|
REMOTE_IP_STRATEGY: JSON.stringify(userConfig.remoteIpStrategy)
|
|
122
|
-
}
|
|
126
|
+
},
|
|
127
|
+
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
|
|
123
128
|
},
|
|
124
129
|
dev: {
|
|
125
130
|
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
|
|
@@ -77,13 +77,7 @@ const moduleFederationSSRPlugin = (userConfig) => ({
|
|
|
77
77
|
};
|
|
78
78
|
},
|
|
79
79
|
config: async () => {
|
|
80
|
-
var _modernjsConfig_source, _modernjsConfig_source1;
|
|
81
|
-
const bundlerType = useAppContext().bundlerType === "rspack" ? "rspack" : "webpack";
|
|
82
|
-
var _modernjsConfig_source_enableAsyncEntry;
|
|
83
80
|
return {
|
|
84
|
-
source: {
|
|
85
|
-
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
|
|
86
|
-
},
|
|
87
81
|
tools: {
|
|
88
82
|
rspack(config, { isServer }) {
|
|
89
83
|
if (isServer) {
|
package/dist/cjs/cli/utils.js
CHANGED
|
@@ -283,8 +283,8 @@ const getIPV4 = () => {
|
|
|
283
283
|
return ipv4Interface.address;
|
|
284
284
|
};
|
|
285
285
|
const SPLIT_CHUNK_MAP = {
|
|
286
|
-
REACT: "
|
|
287
|
-
ROUTER: "
|
|
286
|
+
REACT: "react",
|
|
287
|
+
ROUTER: "router",
|
|
288
288
|
LODASH: "lib-lodash",
|
|
289
289
|
ANTD: "lib-antd",
|
|
290
290
|
ARCO: "lib-arco",
|
|
@@ -22,6 +22,9 @@ function modifyBundlerConfig(options) {
|
|
|
22
22
|
var moduleFederationConfigPlugin = function(userConfig) {
|
|
23
23
|
return {
|
|
24
24
|
name: "@modern-js/plugin-module-federation-config",
|
|
25
|
+
pre: [
|
|
26
|
+
"@modern-js/plugin-initialize"
|
|
27
|
+
],
|
|
25
28
|
post: [
|
|
26
29
|
"@modern-js/plugin-module-federation"
|
|
27
30
|
],
|
|
@@ -47,7 +50,7 @@ var moduleFederationConfigPlugin = function(userConfig) {
|
|
|
47
50
|
2,
|
|
48
51
|
{
|
|
49
52
|
config: /* @__PURE__ */ _async_to_generator(function() {
|
|
50
|
-
var _modernjsConfig_server, _modernjsConfig_dev, bundlerType, ipv4, enableSSR;
|
|
53
|
+
var _modernjsConfig_server, _modernjsConfig_source, _modernjsConfig_source1, _modernjsConfig_dev, bundlerType, ipv4, enableSSR, _modernjsConfig_source_enableAsyncEntry;
|
|
51
54
|
return _ts_generator(this, function(_state2) {
|
|
52
55
|
bundlerType = useAppContext().bundlerType === "rspack" ? "rspack" : "webpack";
|
|
53
56
|
ipv4 = getIPV4();
|
|
@@ -104,7 +107,8 @@ var moduleFederationConfigPlugin = function(userConfig) {
|
|
|
104
107
|
define: {
|
|
105
108
|
FEDERATION_IPV4: JSON.stringify(ipv4),
|
|
106
109
|
REMOTE_IP_STRATEGY: JSON.stringify(userConfig.remoteIpStrategy)
|
|
107
|
-
}
|
|
110
|
+
},
|
|
111
|
+
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
|
|
108
112
|
},
|
|
109
113
|
dev: {
|
|
110
114
|
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
|
|
@@ -54,15 +54,10 @@ var moduleFederationSSRPlugin = function(userConfig) {
|
|
|
54
54
|
};
|
|
55
55
|
},
|
|
56
56
|
config: /* @__PURE__ */ _async_to_generator(function() {
|
|
57
|
-
var _modernjsConfig_source, _modernjsConfig_source1, bundlerType, _modernjsConfig_source_enableAsyncEntry;
|
|
58
57
|
return _ts_generator(this, function(_state2) {
|
|
59
|
-
bundlerType = useAppContext().bundlerType === "rspack" ? "rspack" : "webpack";
|
|
60
58
|
return [
|
|
61
59
|
2,
|
|
62
60
|
{
|
|
63
|
-
source: {
|
|
64
|
-
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
|
|
65
|
-
},
|
|
66
61
|
tools: {
|
|
67
62
|
rspack: function rspack(config, param2) {
|
|
68
63
|
var isServer = param2.isServer;
|
package/dist/esm/cli/utils.js
CHANGED
|
@@ -277,8 +277,8 @@ var getIPV4 = function() {
|
|
|
277
277
|
return ipv4Interface.address;
|
|
278
278
|
};
|
|
279
279
|
var SPLIT_CHUNK_MAP = {
|
|
280
|
-
REACT: "
|
|
281
|
-
ROUTER: "
|
|
280
|
+
REACT: "react",
|
|
281
|
+
ROUTER: "router",
|
|
282
282
|
LODASH: "lib-lodash",
|
|
283
283
|
ANTD: "lib-antd",
|
|
284
284
|
ARCO: "lib-arco",
|
|
@@ -19,6 +19,9 @@ function modifyBundlerConfig(options) {
|
|
|
19
19
|
}
|
|
20
20
|
const moduleFederationConfigPlugin = (userConfig) => ({
|
|
21
21
|
name: "@modern-js/plugin-module-federation-config",
|
|
22
|
+
pre: [
|
|
23
|
+
"@modern-js/plugin-initialize"
|
|
24
|
+
],
|
|
22
25
|
post: [
|
|
23
26
|
"@modern-js/plugin-module-federation"
|
|
24
27
|
],
|
|
@@ -31,7 +34,7 @@ const moduleFederationConfigPlugin = (userConfig) => ({
|
|
|
31
34
|
userConfig.csrConfig = csrConfig;
|
|
32
35
|
return {
|
|
33
36
|
config: async () => {
|
|
34
|
-
var _modernjsConfig_server, _modernjsConfig_dev;
|
|
37
|
+
var _modernjsConfig_server, _modernjsConfig_source, _modernjsConfig_source1, _modernjsConfig_dev;
|
|
35
38
|
const bundlerType = useAppContext().bundlerType === "rspack" ? "rspack" : "webpack";
|
|
36
39
|
const ipv4 = getIPV4();
|
|
37
40
|
const enableSSR = Boolean(modernjsConfig === null || modernjsConfig === void 0 ? void 0 : (_modernjsConfig_server = modernjsConfig.server) === null || _modernjsConfig_server === void 0 ? void 0 : _modernjsConfig_server.ssr);
|
|
@@ -42,6 +45,7 @@ const moduleFederationConfigPlugin = (userConfig) => ({
|
|
|
42
45
|
userConfig.remoteIpStrategy = "ipv4";
|
|
43
46
|
}
|
|
44
47
|
}
|
|
48
|
+
var _modernjsConfig_source_enableAsyncEntry;
|
|
45
49
|
return {
|
|
46
50
|
tools: {
|
|
47
51
|
rspack(config, { isServer }) {
|
|
@@ -83,7 +87,8 @@ const moduleFederationConfigPlugin = (userConfig) => ({
|
|
|
83
87
|
define: {
|
|
84
88
|
FEDERATION_IPV4: JSON.stringify(ipv4),
|
|
85
89
|
REMOTE_IP_STRATEGY: JSON.stringify(userConfig.remoteIpStrategy)
|
|
86
|
-
}
|
|
90
|
+
},
|
|
91
|
+
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
|
|
87
92
|
},
|
|
88
93
|
dev: {
|
|
89
94
|
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
|
|
@@ -42,13 +42,7 @@ const moduleFederationSSRPlugin = (userConfig) => ({
|
|
|
42
42
|
};
|
|
43
43
|
},
|
|
44
44
|
config: async () => {
|
|
45
|
-
var _modernjsConfig_source, _modernjsConfig_source1;
|
|
46
|
-
const bundlerType = useAppContext().bundlerType === "rspack" ? "rspack" : "webpack";
|
|
47
|
-
var _modernjsConfig_source_enableAsyncEntry;
|
|
48
45
|
return {
|
|
49
|
-
source: {
|
|
50
|
-
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
|
|
51
|
-
},
|
|
52
46
|
tools: {
|
|
53
47
|
rspack(config, { isServer }) {
|
|
54
48
|
if (isServer) {
|
|
@@ -246,8 +246,8 @@ const getIPV4 = () => {
|
|
|
246
246
|
return ipv4Interface.address;
|
|
247
247
|
};
|
|
248
248
|
const SPLIT_CHUNK_MAP = {
|
|
249
|
-
REACT: "
|
|
250
|
-
ROUTER: "
|
|
249
|
+
REACT: "react",
|
|
250
|
+
ROUTER: "router",
|
|
251
251
|
LODASH: "lib-lodash",
|
|
252
252
|
ANTD: "lib-antd",
|
|
253
253
|
ARCO: "lib-arco",
|
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.3",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/",
|
|
6
6
|
"types.d.ts",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"node-fetch": "~3.3.0",
|
|
62
62
|
"react-error-boundary": "4.0.13",
|
|
63
63
|
"hoist-non-react-statics": "3.3.2",
|
|
64
|
-
"@module-federation/sdk": "0.6.
|
|
65
|
-
"@module-federation/enhanced": "0.6.
|
|
66
|
-
"@module-federation/node": "2.5.
|
|
64
|
+
"@module-federation/sdk": "0.6.3",
|
|
65
|
+
"@module-federation/enhanced": "0.6.3",
|
|
66
|
+
"@module-federation/node": "2.5.13"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/hoist-non-react-statics": "3.3.2",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@modern-js/runtime": "2.57.0",
|
|
73
73
|
"@modern-js/module-tools": "2.57.0",
|
|
74
74
|
"@modern-js/tsconfig": "2.57.0",
|
|
75
|
-
"@module-federation/manifest": "0.6.
|
|
75
|
+
"@module-federation/manifest": "0.6.3"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": ">=17",
|