@module-federation/modern-js 0.0.0-next-20240819112150 → 0.0.0-next-20240820034939
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/dataLoaderPlugin.js +1 -1
- package/dist/cjs/cli/utils.js +1 -3
- package/dist/esm/cli/dataLoaderPlugin.js +1 -1
- package/dist/esm/cli/utils.js +1 -3
- package/dist/esm-node/cli/dataLoaderPlugin.js +1 -1
- package/dist/esm-node/cli/utils.js +1 -3
- package/dist/types/cli/utils.d.ts +2 -1
- package/package.json +5 -5
|
@@ -133,7 +133,7 @@ async function _fetchSSRByRouteIds(partialSSRRemotes, mfConfig, transformRuntime
|
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
135
|
const runtimeInitOptions = transformRuntimeFn(partialMfConfig);
|
|
136
|
-
(0, import_utils3.replaceRemoteUrl)(
|
|
136
|
+
(0, import_utils3.replaceRemoteUrl)(runtimeInitOptions, "ipv4");
|
|
137
137
|
if (!runtimeInitOptions.remotes.length || !partialSSRRemotes.length) {
|
|
138
138
|
return void 0;
|
|
139
139
|
}
|
package/dist/cjs/cli/utils.js
CHANGED
|
@@ -85,10 +85,8 @@ const replaceRemoteUrl = (mfConfig, remoteIpStrategy) => {
|
|
|
85
85
|
if (typeof remoteObject === "string") {
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
if (
|
|
88
|
+
if ("entry" in remoteObject && typeof remoteObject.entry === "string") {
|
|
89
89
|
remoteObject.entry = remoteObject.entry.replace(import_constant.LOCALHOST, ipv4);
|
|
90
|
-
} else {
|
|
91
|
-
handleRemoteObject(remoteObject);
|
|
92
90
|
}
|
|
93
91
|
});
|
|
94
92
|
} else if (typeof mfConfig.remotes !== "string") {
|
|
@@ -104,7 +104,7 @@ function __fetchSSRByRouteIds() {
|
|
|
104
104
|
remotes: _object_spread({}, mfConfig.remotes)
|
|
105
105
|
};
|
|
106
106
|
runtimeInitOptions = transformRuntimeFn(partialMfConfig);
|
|
107
|
-
replaceRemoteUrl(
|
|
107
|
+
replaceRemoteUrl(runtimeInitOptions, "ipv4");
|
|
108
108
|
if (!runtimeInitOptions.remotes.length || !partialSSRRemotes.length) {
|
|
109
109
|
return [
|
|
110
110
|
2,
|
package/dist/esm/cli/utils.js
CHANGED
|
@@ -79,10 +79,8 @@ var replaceRemoteUrl = function(mfConfig, remoteIpStrategy) {
|
|
|
79
79
|
if (typeof remoteObject === "string") {
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
if (
|
|
82
|
+
if ("entry" in remoteObject && typeof remoteObject.entry === "string") {
|
|
83
83
|
remoteObject.entry = remoteObject.entry.replace(LOCALHOST, ipv4);
|
|
84
|
-
} else {
|
|
85
|
-
handleRemoteObject(remoteObject);
|
|
86
84
|
}
|
|
87
85
|
});
|
|
88
86
|
} else if (typeof mfConfig.remotes !== "string") {
|
|
@@ -97,7 +97,7 @@ async function _fetchSSRByRouteIds(partialSSRRemotes, mfConfig, transformRuntime
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
const runtimeInitOptions = transformRuntimeFn(partialMfConfig);
|
|
100
|
-
replaceRemoteUrl(
|
|
100
|
+
replaceRemoteUrl(runtimeInitOptions, "ipv4");
|
|
101
101
|
if (!runtimeInitOptions.remotes.length || !partialSSRRemotes.length) {
|
|
102
102
|
return void 0;
|
|
103
103
|
}
|
|
@@ -47,10 +47,8 @@ const replaceRemoteUrl = (mfConfig, remoteIpStrategy) => {
|
|
|
47
47
|
if (typeof remoteObject === "string") {
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
if (
|
|
50
|
+
if ("entry" in remoteObject && typeof remoteObject.entry === "string") {
|
|
51
51
|
remoteObject.entry = remoteObject.entry.replace(LOCALHOST, ipv4);
|
|
52
|
-
} else {
|
|
53
|
-
handleRemoteObject(remoteObject);
|
|
54
52
|
}
|
|
55
53
|
});
|
|
56
54
|
} else if (typeof mfConfig.remotes !== "string") {
|
|
@@ -2,9 +2,10 @@ import type { webpack, UserConfig, AppTools, Rspack, Bundler } from '@modern-js/
|
|
|
2
2
|
import { moduleFederationPlugin } from '@module-federation/sdk';
|
|
3
3
|
import { PluginOptions } from '../types';
|
|
4
4
|
import { BundlerConfig } from '../interfaces/bundler';
|
|
5
|
+
import type { init } from '@module-federation/enhanced/runtime';
|
|
5
6
|
export type ConfigType<T> = T extends 'webpack' ? webpack.Configuration : T extends 'rspack' ? Rspack.Configuration : never;
|
|
6
7
|
export declare const getMFConfig: (userConfig: PluginOptions) => Promise<moduleFederationPlugin.ModuleFederationPluginOptions>;
|
|
7
|
-
export declare const replaceRemoteUrl: (mfConfig: moduleFederationPlugin.ModuleFederationPluginOptions, remoteIpStrategy?: "ipv4" | "inherit") => void;
|
|
8
|
+
export declare const replaceRemoteUrl: (mfConfig: moduleFederationPlugin.ModuleFederationPluginOptions | Parameters<typeof init>[0], remoteIpStrategy?: "ipv4" | "inherit") => void;
|
|
8
9
|
export declare const patchMFConfig: (mfConfig: moduleFederationPlugin.ModuleFederationPluginOptions, isServer: boolean, remoteIpStrategy?: "ipv4" | "inherit") => moduleFederationPlugin.ModuleFederationPluginOptions;
|
|
9
10
|
export declare function patchIgnoreWarning<T extends Bundler>(bundlerConfig: BundlerConfig<T>): void;
|
|
10
11
|
export declare function patchBundlerConfig<T extends Bundler>(options: {
|
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-20240820034939",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/",
|
|
6
6
|
"types.d.ts",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"@babel/parser": "7.25.3",
|
|
88
88
|
"@babel/traverse": "7.25.3",
|
|
89
89
|
"@babel/types": "7.25.2",
|
|
90
|
-
"@module-federation/sdk": "0.0.0-next-
|
|
91
|
-
"@module-federation/enhanced": "0.0.0-next-
|
|
92
|
-
"@module-federation/node": "0.0.0-next-
|
|
90
|
+
"@module-federation/sdk": "0.0.0-next-20240820034939",
|
|
91
|
+
"@module-federation/enhanced": "0.0.0-next-20240820034939",
|
|
92
|
+
"@module-federation/node": "0.0.0-next-20240820034939"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@types/babel__traverse": "7.20.6",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@modern-js/runtime": "0.0.0-next-20240816082741",
|
|
102
102
|
"@modern-js/module-tools": "0.0.0-next-20240816082741",
|
|
103
103
|
"@modern-js/tsconfig": "0.0.0-next-20240816082741",
|
|
104
|
-
"@module-federation/manifest": "0.0.0-next-
|
|
104
|
+
"@module-federation/manifest": "0.0.0-next-20240820034939"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"react": ">=17",
|