@module-federation/modern-js 0.0.0-next-20250603083441 → 0.0.0-next-20250603084223

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.
@@ -134,7 +134,7 @@ const patchDTSConfig = (mfConfig, isServer) => {
134
134
  }
135
135
  }
136
136
  };
137
- const patchMFConfig = (mfConfig, isServer, remoteIpStrategy) => {
137
+ const patchMFConfig = (mfConfig, isServer, remoteIpStrategy, enableSSR) => {
138
138
  replaceRemoteUrl(mfConfig, remoteIpStrategy);
139
139
  if (mfConfig.remoteType === void 0) {
140
140
  mfConfig.remoteType = "script";
@@ -147,7 +147,7 @@ const patchMFConfig = (mfConfig, isServer, remoteIpStrategy) => {
147
147
  ];
148
148
  patchDTSConfig(mfConfig, isServer);
149
149
  injectRuntimePlugins(require.resolve("@module-federation/modern-js/shared-strategy"), runtimePlugins);
150
- if (isDev) {
150
+ if (enableSSR && isDev) {
151
151
  injectRuntimePlugins(require.resolve("@module-federation/modern-js/resolve-entry-ipv4"), runtimePlugins);
152
152
  }
153
153
  if (isServer) {
@@ -299,7 +299,7 @@ const moduleFederationConfigPlugin = (userConfig) => ({
299
299
  const isWeb = (0, import_utils.isWebTarget)(target);
300
300
  addMyTypes2Ignored(chain, !isWeb ? ssrConfig : csrConfig);
301
301
  const targetMFConfig = !isWeb ? ssrConfig : csrConfig;
302
- patchMFConfig(targetMFConfig, !isWeb, userConfig.remoteIpStrategy || "ipv4");
302
+ patchMFConfig(targetMFConfig, !isWeb, userConfig.remoteIpStrategy || "ipv4", enableSSR);
303
303
  patchBundlerConfig({
304
304
  // @ts-expect-error chain type is not correct
305
305
  chain,
@@ -341,7 +341,7 @@ const moduleFederationConfigPlugin = (userConfig) => ({
341
341
  const defineConfig = {
342
342
  REMOTE_IP_STRATEGY: JSON.stringify(userConfig.remoteIpStrategy)
343
343
  };
344
- if (isDev) {
344
+ if (enableSSR && isDev) {
345
345
  defineConfig["FEDERATION_IPV4"] = JSON.stringify(ipv4);
346
346
  }
347
347
  var _modernjsConfig_source_enableAsyncEntry;
@@ -126,7 +126,7 @@ var patchDTSConfig = function(mfConfig, isServer) {
126
126
  }
127
127
  }
128
128
  };
129
- var patchMFConfig = function(mfConfig, isServer, remoteIpStrategy) {
129
+ var patchMFConfig = function(mfConfig, isServer, remoteIpStrategy, enableSSR) {
130
130
  replaceRemoteUrl(mfConfig, remoteIpStrategy);
131
131
  if (mfConfig.remoteType === void 0) {
132
132
  mfConfig.remoteType = "script";
@@ -137,7 +137,7 @@ var patchMFConfig = function(mfConfig, isServer, remoteIpStrategy) {
137
137
  var runtimePlugins = _to_consumable_array(mfConfig.runtimePlugins || []);
138
138
  patchDTSConfig(mfConfig, isServer);
139
139
  injectRuntimePlugins(require.resolve("@module-federation/modern-js/shared-strategy"), runtimePlugins);
140
- if (isDev) {
140
+ if (enableSSR && isDev) {
141
141
  injectRuntimePlugins(require.resolve("@module-federation/modern-js/resolve-entry-ipv4"), runtimePlugins);
142
142
  }
143
143
  if (isServer) {
@@ -296,7 +296,7 @@ var moduleFederationConfigPlugin = function(userConfig) {
296
296
  var isWeb = isWebTarget(target);
297
297
  addMyTypes2Ignored(chain, !isWeb ? ssrConfig : csrConfig);
298
298
  var targetMFConfig = !isWeb ? ssrConfig : csrConfig;
299
- patchMFConfig(targetMFConfig, !isWeb, userConfig.remoteIpStrategy || "ipv4");
299
+ patchMFConfig(targetMFConfig, !isWeb, userConfig.remoteIpStrategy || "ipv4", enableSSR);
300
300
  patchBundlerConfig({
301
301
  // @ts-expect-error chain type is not correct
302
302
  chain,
@@ -338,7 +338,7 @@ var moduleFederationConfigPlugin = function(userConfig) {
338
338
  var defineConfig = {
339
339
  REMOTE_IP_STRATEGY: JSON.stringify(userConfig.remoteIpStrategy)
340
340
  };
341
- if (isDev) {
341
+ if (enableSSR && isDev) {
342
342
  defineConfig["FEDERATION_IPV4"] = JSON.stringify(ipv4);
343
343
  }
344
344
  var _modernjsConfig_source_enableAsyncEntry;
@@ -93,7 +93,7 @@ const patchDTSConfig = (mfConfig, isServer) => {
93
93
  }
94
94
  }
95
95
  };
96
- const patchMFConfig = (mfConfig, isServer, remoteIpStrategy) => {
96
+ const patchMFConfig = (mfConfig, isServer, remoteIpStrategy, enableSSR) => {
97
97
  replaceRemoteUrl(mfConfig, remoteIpStrategy);
98
98
  if (mfConfig.remoteType === void 0) {
99
99
  mfConfig.remoteType = "script";
@@ -106,7 +106,7 @@ const patchMFConfig = (mfConfig, isServer, remoteIpStrategy) => {
106
106
  ];
107
107
  patchDTSConfig(mfConfig, isServer);
108
108
  injectRuntimePlugins(require.resolve("@module-federation/modern-js/shared-strategy"), runtimePlugins);
109
- if (isDev) {
109
+ if (enableSSR && isDev) {
110
110
  injectRuntimePlugins(require.resolve("@module-federation/modern-js/resolve-entry-ipv4"), runtimePlugins);
111
111
  }
112
112
  if (isServer) {
@@ -258,7 +258,7 @@ const moduleFederationConfigPlugin = (userConfig) => ({
258
258
  const isWeb = isWebTarget(target);
259
259
  addMyTypes2Ignored(chain, !isWeb ? ssrConfig : csrConfig);
260
260
  const targetMFConfig = !isWeb ? ssrConfig : csrConfig;
261
- patchMFConfig(targetMFConfig, !isWeb, userConfig.remoteIpStrategy || "ipv4");
261
+ patchMFConfig(targetMFConfig, !isWeb, userConfig.remoteIpStrategy || "ipv4", enableSSR);
262
262
  patchBundlerConfig({
263
263
  // @ts-expect-error chain type is not correct
264
264
  chain,
@@ -300,7 +300,7 @@ const moduleFederationConfigPlugin = (userConfig) => ({
300
300
  const defineConfig = {
301
301
  REMOTE_IP_STRATEGY: JSON.stringify(userConfig.remoteIpStrategy)
302
302
  };
303
- if (isDev) {
303
+ if (enableSSR && isDev) {
304
304
  defineConfig["FEDERATION_IPV4"] = JSON.stringify(ipv4);
305
305
  }
306
306
  var _modernjsConfig_source_enableAsyncEntry;
@@ -7,7 +7,7 @@ import type { BundlerChainConfig } from '../interfaces/bundler';
7
7
  export type ConfigType<T> = T extends 'webpack' ? webpack.Configuration : T extends 'rspack' ? Rspack.Configuration : never;
8
8
  export declare function setEnv(enableSSR: boolean): void;
9
9
  export declare const getMFConfig: (userConfig: PluginOptions) => Promise<moduleFederationPlugin.ModuleFederationPluginOptions>;
10
- export declare const patchMFConfig: (mfConfig: moduleFederationPlugin.ModuleFederationPluginOptions, isServer: boolean, remoteIpStrategy?: "ipv4" | "inherit") => moduleFederationPlugin.ModuleFederationPluginOptions;
10
+ export declare const patchMFConfig: (mfConfig: moduleFederationPlugin.ModuleFederationPluginOptions, isServer: boolean, remoteIpStrategy?: "ipv4" | "inherit", enableSSR?: boolean) => moduleFederationPlugin.ModuleFederationPluginOptions;
11
11
  export declare function addMyTypes2Ignored(chain: BundlerChainConfig, mfConfig: moduleFederationPlugin.ModuleFederationPluginOptions): void;
12
12
  export declare function patchBundlerConfig(options: {
13
13
  chain: BundlerChainConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/modern-js",
3
- "version": "0.0.0-next-20250603083441",
3
+ "version": "0.0.0-next-20250603084223",
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-20250603083441",
101
- "@module-federation/enhanced": "0.0.0-next-20250603083441",
102
- "@module-federation/node": "0.0.0-next-20250603083441",
103
- "@module-federation/sdk": "0.0.0-next-20250603083441",
104
- "@module-federation/cli": "0.0.0-next-20250603083441"
100
+ "@module-federation/rsbuild-plugin": "0.0.0-next-20250603084223",
101
+ "@module-federation/enhanced": "0.0.0-next-20250603084223",
102
+ "@module-federation/node": "0.0.0-next-20250603084223",
103
+ "@module-federation/sdk": "0.0.0-next-20250603084223",
104
+ "@module-federation/cli": "0.0.0-next-20250603084223"
105
105
  },
106
106
  "devDependencies": {
107
107
  "@rsbuild/core": "1.2.8",
@@ -110,7 +110,7 @@
110
110
  "@modern-js/module-tools": "2.67.6",
111
111
  "@modern-js/runtime": "2.67.6",
112
112
  "@modern-js/tsconfig": "2.67.6",
113
- "@module-federation/manifest": "0.0.0-next-20250603083441"
113
+ "@module-federation/manifest": "0.0.0-next-20250603084223"
114
114
  },
115
115
  "peerDependencies": {
116
116
  "react": ">=17",