@module-federation/modern-js 0.20.0 → 0.21.1
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.
|
@@ -40,7 +40,6 @@ __export(configPlugin_exports, {
|
|
|
40
40
|
});
|
|
41
41
|
module.exports = __toCommonJS(configPlugin_exports);
|
|
42
42
|
var import_path = __toESM(require("path"));
|
|
43
|
-
var import_fs = __toESM(require("fs"));
|
|
44
43
|
var import_utils = require("./utils");
|
|
45
44
|
var import_sdk = require("@module-federation/sdk");
|
|
46
45
|
var import_node_bundle_require = require("@modern-js/node-bundle-require");
|
|
@@ -154,17 +153,6 @@ const patchMFConfig = (mfConfig, isServer, remoteIpStrategy, enableSSR) => {
|
|
|
154
153
|
const runtimePlugins = [
|
|
155
154
|
...mfConfig.runtimePlugins || []
|
|
156
155
|
];
|
|
157
|
-
try {
|
|
158
|
-
const nodeModulesPath = import_path.default.resolve(process.cwd(), "node_modules");
|
|
159
|
-
const bridgeReactPath = import_path.default.join(nodeModulesPath, "@module-federation/bridge-react");
|
|
160
|
-
if (import_fs.default.existsSync(bridgeReactPath) && (!(mfConfig === null || mfConfig === void 0 ? void 0 : mfConfig.bridge) || !mfConfig.bridge.disableAlias)) {
|
|
161
|
-
mfConfig.bridge = {
|
|
162
|
-
disableAlias: true
|
|
163
|
-
};
|
|
164
|
-
import_logger.default.debug(`${import_constant.PLUGIN_IDENTIFIER} use "@module-federation/modern-js/react" instead of "@module-federation/bridge-react" !`);
|
|
165
|
-
}
|
|
166
|
-
} catch (e) {
|
|
167
|
-
}
|
|
168
156
|
patchDTSConfig(mfConfig, isServer);
|
|
169
157
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/shared-strategy"), runtimePlugins);
|
|
170
158
|
if (enableSSR && (0, import_utils3.isDev)()) {
|
|
@@ -5,7 +5,6 @@ import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
|
5
5
|
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
6
6
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
7
7
|
import path from "path";
|
|
8
|
-
import fs from "fs";
|
|
9
8
|
import { getIPV4, isWebTarget, skipByTarget } from "./utils";
|
|
10
9
|
import { encodeName } from "@module-federation/sdk";
|
|
11
10
|
import { bundle } from "@modern-js/node-bundle-require";
|
|
@@ -144,17 +143,6 @@ var patchMFConfig = function(mfConfig, isServer, remoteIpStrategy, enableSSR) {
|
|
|
144
143
|
throw new Error("".concat(PLUGIN_IDENTIFIER, " mfConfig.name can not be empty!"));
|
|
145
144
|
}
|
|
146
145
|
var runtimePlugins = _to_consumable_array(mfConfig.runtimePlugins || []);
|
|
147
|
-
try {
|
|
148
|
-
var nodeModulesPath = path.resolve(process.cwd(), "node_modules");
|
|
149
|
-
var bridgeReactPath = path.join(nodeModulesPath, "@module-federation/bridge-react");
|
|
150
|
-
if (fs.existsSync(bridgeReactPath) && (!(mfConfig === null || mfConfig === void 0 ? void 0 : mfConfig.bridge) || !mfConfig.bridge.disableAlias)) {
|
|
151
|
-
mfConfig.bridge = {
|
|
152
|
-
disableAlias: true
|
|
153
|
-
};
|
|
154
|
-
logger.debug("".concat(PLUGIN_IDENTIFIER, ' use "@module-federation/modern-js/react" instead of "@module-federation/bridge-react" !'));
|
|
155
|
-
}
|
|
156
|
-
} catch (e) {
|
|
157
|
-
}
|
|
158
146
|
patchDTSConfig(mfConfig, isServer);
|
|
159
147
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/shared-strategy"), runtimePlugins);
|
|
160
148
|
if (enableSSR && isDev()) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
import fs from "fs";
|
|
3
2
|
import { getIPV4, isWebTarget, skipByTarget } from "./utils";
|
|
4
3
|
import { encodeName } from "@module-federation/sdk";
|
|
5
4
|
import { bundle } from "@modern-js/node-bundle-require";
|
|
@@ -113,17 +112,6 @@ const patchMFConfig = (mfConfig, isServer, remoteIpStrategy, enableSSR) => {
|
|
|
113
112
|
const runtimePlugins = [
|
|
114
113
|
...mfConfig.runtimePlugins || []
|
|
115
114
|
];
|
|
116
|
-
try {
|
|
117
|
-
const nodeModulesPath = path.resolve(process.cwd(), "node_modules");
|
|
118
|
-
const bridgeReactPath = path.join(nodeModulesPath, "@module-federation/bridge-react");
|
|
119
|
-
if (fs.existsSync(bridgeReactPath) && (!(mfConfig === null || mfConfig === void 0 ? void 0 : mfConfig.bridge) || !mfConfig.bridge.disableAlias)) {
|
|
120
|
-
mfConfig.bridge = {
|
|
121
|
-
disableAlias: true
|
|
122
|
-
};
|
|
123
|
-
logger.debug(`${PLUGIN_IDENTIFIER} use "@module-federation/modern-js/react" instead of "@module-federation/bridge-react" !`);
|
|
124
|
-
}
|
|
125
|
-
} catch (e) {
|
|
126
|
-
}
|
|
127
115
|
patchDTSConfig(mfConfig, isServer);
|
|
128
116
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/shared-strategy"), runtimePlugins);
|
|
129
117
|
if (enableSSR && isDev()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/modern-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/",
|
|
6
6
|
"types.d.ts",
|
|
@@ -119,13 +119,13 @@
|
|
|
119
119
|
"@swc/helpers": "^0.5.17",
|
|
120
120
|
"node-fetch": "~3.3.0",
|
|
121
121
|
"react-error-boundary": "4.1.2",
|
|
122
|
-
"@module-federation/rsbuild-plugin": "0.
|
|
123
|
-
"@module-federation/enhanced": "0.
|
|
124
|
-
"@module-federation/runtime": "0.
|
|
125
|
-
"@module-federation/node": "2.7.
|
|
126
|
-
"@module-federation/bridge-react": "0.
|
|
127
|
-
"@module-federation/
|
|
128
|
-
"@module-federation/
|
|
122
|
+
"@module-federation/rsbuild-plugin": "0.21.1",
|
|
123
|
+
"@module-federation/enhanced": "0.21.1",
|
|
124
|
+
"@module-federation/runtime": "0.21.1",
|
|
125
|
+
"@module-federation/node": "2.7.20",
|
|
126
|
+
"@module-federation/bridge-react": "0.21.1",
|
|
127
|
+
"@module-federation/sdk": "0.21.1",
|
|
128
|
+
"@module-federation/cli": "0.21.1"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
131
|
"@modern-js/core": "2.68.2",
|
|
@@ -137,13 +137,15 @@
|
|
|
137
137
|
"@modern-js/tsconfig": "2.68.2",
|
|
138
138
|
"@types/react": "^18.3.11",
|
|
139
139
|
"@types/react-dom": "^18.3.0",
|
|
140
|
-
"@module-federation/manifest": "0.
|
|
140
|
+
"@module-federation/manifest": "0.21.1"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {
|
|
143
143
|
"react": ">=17",
|
|
144
144
|
"react-dom": ">=17",
|
|
145
145
|
"typescript": "^4.9.0 || ^5.0.0",
|
|
146
|
-
"vue-tsc": "^1.0.24"
|
|
146
|
+
"vue-tsc": "^1.0.24",
|
|
147
|
+
"react-router-dom": "^4 || ^5 || ^6 || ^7",
|
|
148
|
+
"react-router": "^7"
|
|
147
149
|
},
|
|
148
150
|
"peerDependenciesMeta": {
|
|
149
151
|
"typescript": {
|
|
@@ -151,6 +153,12 @@
|
|
|
151
153
|
},
|
|
152
154
|
"vue-tsc": {
|
|
153
155
|
"optional": true
|
|
156
|
+
},
|
|
157
|
+
"react-router-dom": {
|
|
158
|
+
"optional": true
|
|
159
|
+
},
|
|
160
|
+
"react-router": {
|
|
161
|
+
"optional": true
|
|
154
162
|
}
|
|
155
163
|
},
|
|
156
164
|
"scripts": {
|