@module-federation/modern-js 0.0.0-next-20250327064442 → 0.0.0-next-20250328031116
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/utils.js +0 -1
- package/dist/cjs/cli/utils.spec.js +1 -2
- package/dist/esm/cli/utils.js +0 -1
- package/dist/esm/cli/utils.spec.js +1 -2
- package/dist/esm-node/cli/utils.js +0 -1
- package/dist/esm-node/cli/utils.spec.js +1 -2
- package/package.json +7 -15
- package/dist/cjs/cli/mfRuntimePlugins/correct-ssr-public-path.js +0 -49
- package/dist/esm/cli/mfRuntimePlugins/correct-ssr-public-path.js +0 -31
- package/dist/esm-node/cli/mfRuntimePlugins/correct-ssr-public-path.js +0 -29
- package/dist/types/cli/mfRuntimePlugins/correct-ssr-public-path.d.ts +0 -3
package/dist/cjs/cli/utils.js
CHANGED
|
@@ -148,7 +148,6 @@ const patchMFConfig = (mfConfig, isServer, remoteIpStrategy) => {
|
|
|
148
148
|
injectRuntimePlugins(require.resolve("@module-federation/node/record-dynamic-remote-entry-hash-plugin"), runtimePlugins);
|
|
149
149
|
}
|
|
150
150
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/inject-node-fetch"), runtimePlugins);
|
|
151
|
-
injectRuntimePlugins(require.resolve("@module-federation/modern-js/correct-ssr-public-path"), runtimePlugins);
|
|
152
151
|
if (!mfConfig.library) {
|
|
153
152
|
mfConfig.library = {
|
|
154
153
|
type: "commonjs-module",
|
|
@@ -61,8 +61,7 @@ const mfConfig = {
|
|
|
61
61
|
runtimePlugins: [
|
|
62
62
|
require.resolve("@module-federation/modern-js/shared-strategy"),
|
|
63
63
|
require.resolve("@module-federation/node/runtimePlugin"),
|
|
64
|
-
require.resolve("@module-federation/modern-js/inject-node-fetch")
|
|
65
|
-
require.resolve("@module-federation/modern-js/correct-ssr-public-path")
|
|
64
|
+
require.resolve("@module-federation/modern-js/inject-node-fetch")
|
|
66
65
|
],
|
|
67
66
|
shared: {
|
|
68
67
|
react: {
|
package/dist/esm/cli/utils.js
CHANGED
|
@@ -140,7 +140,6 @@ var patchMFConfig = function(mfConfig, isServer, remoteIpStrategy) {
|
|
|
140
140
|
injectRuntimePlugins(require.resolve("@module-federation/node/record-dynamic-remote-entry-hash-plugin"), runtimePlugins);
|
|
141
141
|
}
|
|
142
142
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/inject-node-fetch"), runtimePlugins);
|
|
143
|
-
injectRuntimePlugins(require.resolve("@module-federation/modern-js/correct-ssr-public-path"), runtimePlugins);
|
|
144
143
|
if (!mfConfig.library) {
|
|
145
144
|
mfConfig.library = {
|
|
146
145
|
type: "commonjs-module",
|
|
@@ -43,8 +43,7 @@ describe("patchMFConfig", /* @__PURE__ */ _async_to_generator(function() {
|
|
|
43
43
|
runtimePlugins: [
|
|
44
44
|
require.resolve("@module-federation/modern-js/shared-strategy"),
|
|
45
45
|
require.resolve("@module-federation/node/runtimePlugin"),
|
|
46
|
-
require.resolve("@module-federation/modern-js/inject-node-fetch")
|
|
47
|
-
require.resolve("@module-federation/modern-js/correct-ssr-public-path")
|
|
46
|
+
require.resolve("@module-federation/modern-js/inject-node-fetch")
|
|
48
47
|
],
|
|
49
48
|
shared: {
|
|
50
49
|
react: {
|
|
@@ -109,7 +109,6 @@ const patchMFConfig = (mfConfig, isServer, remoteIpStrategy) => {
|
|
|
109
109
|
injectRuntimePlugins(require.resolve("@module-federation/node/record-dynamic-remote-entry-hash-plugin"), runtimePlugins);
|
|
110
110
|
}
|
|
111
111
|
injectRuntimePlugins(require.resolve("@module-federation/modern-js/inject-node-fetch"), runtimePlugins);
|
|
112
|
-
injectRuntimePlugins(require.resolve("@module-federation/modern-js/correct-ssr-public-path"), runtimePlugins);
|
|
113
112
|
if (!mfConfig.library) {
|
|
114
113
|
mfConfig.library = {
|
|
115
114
|
type: "commonjs-module",
|
|
@@ -38,8 +38,7 @@ describe("patchMFConfig", async () => {
|
|
|
38
38
|
runtimePlugins: [
|
|
39
39
|
require.resolve("@module-federation/modern-js/shared-strategy"),
|
|
40
40
|
require.resolve("@module-federation/node/runtimePlugin"),
|
|
41
|
-
require.resolve("@module-federation/modern-js/inject-node-fetch")
|
|
42
|
-
require.resolve("@module-federation/modern-js/correct-ssr-public-path")
|
|
41
|
+
require.resolve("@module-federation/modern-js/inject-node-fetch")
|
|
43
42
|
],
|
|
44
43
|
shared: {
|
|
45
44
|
react: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/modern-js",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-20250328031116",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/",
|
|
6
6
|
"types.d.ts",
|
|
@@ -52,11 +52,6 @@
|
|
|
52
52
|
"types": "./dist/types/cli/mfRuntimePlugins/inject-node-fetch.d.ts",
|
|
53
53
|
"import": "./dist/esm/cli/mfRuntimePlugins/inject-node-fetch.js",
|
|
54
54
|
"require": "./dist/esm/cli/mfRuntimePlugins/inject-node-fetch.js"
|
|
55
|
-
},
|
|
56
|
-
"./correct-ssr-public-path": {
|
|
57
|
-
"types": "./dist/types/cli/mfRuntimePlugins/correct-ssr-public-path.d.ts",
|
|
58
|
-
"import": "./dist/esm/cli/mfRuntimePlugins/correct-ssr-public-path.js",
|
|
59
|
-
"require": "./dist/esm/cli/mfRuntimePlugins/correct-ssr-public-path.js"
|
|
60
55
|
}
|
|
61
56
|
},
|
|
62
57
|
"typesVersions": {
|
|
@@ -81,9 +76,6 @@
|
|
|
81
76
|
],
|
|
82
77
|
"inject-node-fetch": [
|
|
83
78
|
"./dist/types/cli/mfRuntimePlugins/inject-node-fetch.d.ts"
|
|
84
|
-
],
|
|
85
|
-
"correct-ssr-public-path": [
|
|
86
|
-
"./dist/types/cli/mfRuntimePlugins/correct-ssr-public-path.d.ts"
|
|
87
79
|
]
|
|
88
80
|
}
|
|
89
81
|
},
|
|
@@ -97,11 +89,11 @@
|
|
|
97
89
|
"@swc/helpers": "0.5.13",
|
|
98
90
|
"node-fetch": "~3.3.0",
|
|
99
91
|
"react-error-boundary": "4.1.2",
|
|
100
|
-
"@module-federation/rsbuild-plugin": "0.0.0-next-
|
|
101
|
-
"@module-federation/enhanced": "0.0.0-next-
|
|
102
|
-
"@module-federation/node": "0.0.0-next-
|
|
103
|
-
"@module-federation/sdk": "0.0.0-next-
|
|
104
|
-
"@module-federation/cli": "0.0.0-next-
|
|
92
|
+
"@module-federation/rsbuild-plugin": "0.0.0-next-20250328031116",
|
|
93
|
+
"@module-federation/enhanced": "0.0.0-next-20250328031116",
|
|
94
|
+
"@module-federation/node": "0.0.0-next-20250328031116",
|
|
95
|
+
"@module-federation/sdk": "0.0.0-next-20250328031116",
|
|
96
|
+
"@module-federation/cli": "0.0.0-next-20250328031116"
|
|
105
97
|
},
|
|
106
98
|
"devDependencies": {
|
|
107
99
|
"@modern-js/app-tools": "2.65.1",
|
|
@@ -109,7 +101,7 @@
|
|
|
109
101
|
"@modern-js/module-tools": "2.65.1",
|
|
110
102
|
"@modern-js/runtime": "2.65.1",
|
|
111
103
|
"@modern-js/tsconfig": "2.65.1",
|
|
112
|
-
"@module-federation/manifest": "0.0.0-next-
|
|
104
|
+
"@module-federation/manifest": "0.0.0-next-20250328031116"
|
|
113
105
|
},
|
|
114
106
|
"peerDependencies": {
|
|
115
107
|
"react": ">=17",
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var correct_ssr_public_path_exports = {};
|
|
20
|
-
__export(correct_ssr_public_path_exports, {
|
|
21
|
-
default: () => correct_ssr_public_path_default
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(correct_ssr_public_path_exports);
|
|
24
|
-
var import_runtime_core = require("@module-federation/enhanced/runtime-core");
|
|
25
|
-
const correctSsrPublicPathPlugin = () => ({
|
|
26
|
-
name: "correct-ssr-public-path-plugin",
|
|
27
|
-
beforeInit(args) {
|
|
28
|
-
const { options, userOptions } = args;
|
|
29
|
-
if (typeof window !== "undefined" || !userOptions.version) {
|
|
30
|
-
return args;
|
|
31
|
-
}
|
|
32
|
-
if (typeof __webpack_require__ !== "undefined" && __webpack_require__.p) {
|
|
33
|
-
const publicPath = __webpack_require__.p;
|
|
34
|
-
const snapshot = (0, import_runtime_core.getGlobalSnapshotInfoByModuleInfo)({
|
|
35
|
-
version: userOptions.version,
|
|
36
|
-
name: options.name
|
|
37
|
-
});
|
|
38
|
-
if (!snapshot || !("ssrRemoteEntry" in snapshot) || !snapshot.ssrRemoteEntry) {
|
|
39
|
-
return args;
|
|
40
|
-
}
|
|
41
|
-
const ssrPath = snapshot.ssrRemoteEntry.split("/").slice(0, -1).join("/") + "/";
|
|
42
|
-
if (!publicPath.endsWith(ssrPath)) {
|
|
43
|
-
__webpack_require__.p = publicPath + ssrPath;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return args;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
var correct_ssr_public_path_default = correctSsrPublicPathPlugin;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { getGlobalSnapshotInfoByModuleInfo } from "@module-federation/enhanced/runtime-core";
|
|
2
|
-
var correctSsrPublicPathPlugin = function() {
|
|
3
|
-
return {
|
|
4
|
-
name: "correct-ssr-public-path-plugin",
|
|
5
|
-
beforeInit: function beforeInit(args) {
|
|
6
|
-
var options = args.options, userOptions = args.userOptions;
|
|
7
|
-
if (typeof window !== "undefined" || !userOptions.version) {
|
|
8
|
-
return args;
|
|
9
|
-
}
|
|
10
|
-
if (typeof __webpack_require__ !== "undefined" && __webpack_require__.p) {
|
|
11
|
-
var publicPath = __webpack_require__.p;
|
|
12
|
-
var snapshot = getGlobalSnapshotInfoByModuleInfo({
|
|
13
|
-
version: userOptions.version,
|
|
14
|
-
name: options.name
|
|
15
|
-
});
|
|
16
|
-
if (!snapshot || !("ssrRemoteEntry" in snapshot) || !snapshot.ssrRemoteEntry) {
|
|
17
|
-
return args;
|
|
18
|
-
}
|
|
19
|
-
var ssrPath = snapshot.ssrRemoteEntry.split("/").slice(0, -1).join("/") + "/";
|
|
20
|
-
if (!publicPath.endsWith(ssrPath)) {
|
|
21
|
-
__webpack_require__.p = publicPath + ssrPath;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return args;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
var correct_ssr_public_path_default = correctSsrPublicPathPlugin;
|
|
29
|
-
export {
|
|
30
|
-
correct_ssr_public_path_default as default
|
|
31
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { getGlobalSnapshotInfoByModuleInfo } from "@module-federation/enhanced/runtime-core";
|
|
2
|
-
const correctSsrPublicPathPlugin = () => ({
|
|
3
|
-
name: "correct-ssr-public-path-plugin",
|
|
4
|
-
beforeInit(args) {
|
|
5
|
-
const { options, userOptions } = args;
|
|
6
|
-
if (typeof window !== "undefined" || !userOptions.version) {
|
|
7
|
-
return args;
|
|
8
|
-
}
|
|
9
|
-
if (typeof __webpack_require__ !== "undefined" && __webpack_require__.p) {
|
|
10
|
-
const publicPath = __webpack_require__.p;
|
|
11
|
-
const snapshot = getGlobalSnapshotInfoByModuleInfo({
|
|
12
|
-
version: userOptions.version,
|
|
13
|
-
name: options.name
|
|
14
|
-
});
|
|
15
|
-
if (!snapshot || !("ssrRemoteEntry" in snapshot) || !snapshot.ssrRemoteEntry) {
|
|
16
|
-
return args;
|
|
17
|
-
}
|
|
18
|
-
const ssrPath = snapshot.ssrRemoteEntry.split("/").slice(0, -1).join("/") + "/";
|
|
19
|
-
if (!publicPath.endsWith(ssrPath)) {
|
|
20
|
-
__webpack_require__.p = publicPath + ssrPath;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return args;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
var correct_ssr_public_path_default = correctSsrPublicPathPlugin;
|
|
27
|
-
export {
|
|
28
|
-
correct_ssr_public_path_default as default
|
|
29
|
-
};
|