@module-federation/modern-js 0.0.0-next-20250327053300 → 0.0.0-next-20250327064442

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.
@@ -25,21 +25,21 @@ var import_runtime_core = require("@module-federation/enhanced/runtime-core");
25
25
  const correctSsrPublicPathPlugin = () => ({
26
26
  name: "correct-ssr-public-path-plugin",
27
27
  beforeInit(args) {
28
- const { options } = args;
29
- if (typeof window !== "undefined" || !options.version) {
28
+ const { options, userOptions } = args;
29
+ if (typeof window !== "undefined" || !userOptions.version) {
30
30
  return args;
31
31
  }
32
32
  if (typeof __webpack_require__ !== "undefined" && __webpack_require__.p) {
33
33
  const publicPath = __webpack_require__.p;
34
34
  const snapshot = (0, import_runtime_core.getGlobalSnapshotInfoByModuleInfo)({
35
- version: options.version,
35
+ version: userOptions.version,
36
36
  name: options.name
37
37
  });
38
38
  if (!snapshot || !("ssrRemoteEntry" in snapshot) || !snapshot.ssrRemoteEntry) {
39
39
  return args;
40
40
  }
41
41
  const ssrPath = snapshot.ssrRemoteEntry.split("/").slice(0, -1).join("/") + "/";
42
- if (publicPath.endsWith(ssrPath)) {
42
+ if (!publicPath.endsWith(ssrPath)) {
43
43
  __webpack_require__.p = publicPath + ssrPath;
44
44
  }
45
45
  }
@@ -3,21 +3,21 @@ var correctSsrPublicPathPlugin = function() {
3
3
  return {
4
4
  name: "correct-ssr-public-path-plugin",
5
5
  beforeInit: function beforeInit(args) {
6
- var options = args.options;
7
- if (typeof window !== "undefined" || !options.version) {
6
+ var options = args.options, userOptions = args.userOptions;
7
+ if (typeof window !== "undefined" || !userOptions.version) {
8
8
  return args;
9
9
  }
10
10
  if (typeof __webpack_require__ !== "undefined" && __webpack_require__.p) {
11
11
  var publicPath = __webpack_require__.p;
12
12
  var snapshot = getGlobalSnapshotInfoByModuleInfo({
13
- version: options.version,
13
+ version: userOptions.version,
14
14
  name: options.name
15
15
  });
16
16
  if (!snapshot || !("ssrRemoteEntry" in snapshot) || !snapshot.ssrRemoteEntry) {
17
17
  return args;
18
18
  }
19
19
  var ssrPath = snapshot.ssrRemoteEntry.split("/").slice(0, -1).join("/") + "/";
20
- if (publicPath.endsWith(ssrPath)) {
20
+ if (!publicPath.endsWith(ssrPath)) {
21
21
  __webpack_require__.p = publicPath + ssrPath;
22
22
  }
23
23
  }
@@ -2,21 +2,21 @@ import { getGlobalSnapshotInfoByModuleInfo } from "@module-federation/enhanced/r
2
2
  const correctSsrPublicPathPlugin = () => ({
3
3
  name: "correct-ssr-public-path-plugin",
4
4
  beforeInit(args) {
5
- const { options } = args;
6
- if (typeof window !== "undefined" || !options.version) {
5
+ const { options, userOptions } = args;
6
+ if (typeof window !== "undefined" || !userOptions.version) {
7
7
  return args;
8
8
  }
9
9
  if (typeof __webpack_require__ !== "undefined" && __webpack_require__.p) {
10
10
  const publicPath = __webpack_require__.p;
11
11
  const snapshot = getGlobalSnapshotInfoByModuleInfo({
12
- version: options.version,
12
+ version: userOptions.version,
13
13
  name: options.name
14
14
  });
15
15
  if (!snapshot || !("ssrRemoteEntry" in snapshot) || !snapshot.ssrRemoteEntry) {
16
16
  return args;
17
17
  }
18
18
  const ssrPath = snapshot.ssrRemoteEntry.split("/").slice(0, -1).join("/") + "/";
19
- if (publicPath.endsWith(ssrPath)) {
19
+ if (!publicPath.endsWith(ssrPath)) {
20
20
  __webpack_require__.p = publicPath + ssrPath;
21
21
  }
22
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/modern-js",
3
- "version": "0.0.0-next-20250327053300",
3
+ "version": "0.0.0-next-20250327064442",
4
4
  "files": [
5
5
  "dist/",
6
6
  "types.d.ts",
@@ -97,11 +97,11 @@
97
97
  "@swc/helpers": "0.5.13",
98
98
  "node-fetch": "~3.3.0",
99
99
  "react-error-boundary": "4.1.2",
100
- "@module-federation/rsbuild-plugin": "0.0.0-next-20250327053300",
101
- "@module-federation/enhanced": "0.0.0-next-20250327053300",
102
- "@module-federation/node": "0.0.0-next-20250327053300",
103
- "@module-federation/sdk": "0.0.0-next-20250327053300",
104
- "@module-federation/cli": "0.0.0-next-20250327053300"
100
+ "@module-federation/rsbuild-plugin": "0.0.0-next-20250327064442",
101
+ "@module-federation/enhanced": "0.0.0-next-20250327064442",
102
+ "@module-federation/node": "0.0.0-next-20250327064442",
103
+ "@module-federation/sdk": "0.0.0-next-20250327064442",
104
+ "@module-federation/cli": "0.0.0-next-20250327064442"
105
105
  },
106
106
  "devDependencies": {
107
107
  "@modern-js/app-tools": "2.65.1",
@@ -109,7 +109,7 @@
109
109
  "@modern-js/module-tools": "2.65.1",
110
110
  "@modern-js/runtime": "2.65.1",
111
111
  "@modern-js/tsconfig": "2.65.1",
112
- "@module-federation/manifest": "0.0.0-next-20250327053300"
112
+ "@module-federation/manifest": "0.0.0-next-20250327064442"
113
113
  },
114
114
  "peerDependencies": {
115
115
  "react": ">=17",