@module-federation/rsbuild-plugin 2.7.0 → 2.8.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.
@@ -35,7 +35,9 @@ export declare function createSSRMFConfig(mfConfig: moduleFederationPlugin.Modul
35
35
  asyncStartup?: boolean;
36
36
  optimization?: {
37
37
  disableSnapshot?: boolean;
38
- target?: "web" | "node";
38
+ disableRemote?: boolean;
39
+ disableShared?: boolean;
40
+ target?: 'web' | 'node';
39
41
  };
40
42
  };
41
43
  bridge?: {
package/dist/utils/ssr.js CHANGED
@@ -117,6 +117,22 @@ function patchNodeConfig(config, mfConfig) {
117
117
  config.output.module = false;
118
118
  config.output.chunkFormat = 'commonjs';
119
119
  config.output.chunkLoading = 'async-node';
120
+ const prevLibrary = config.output.library;
121
+ if (prevLibrary && typeof prevLibrary === 'object' && !Array.isArray(prevLibrary)) {
122
+ config.output.library = {
123
+ ...prevLibrary,
124
+ type: 'commonjs-module'
125
+ };
126
+ } else if (typeof prevLibrary === 'string' || Array.isArray(prevLibrary)) {
127
+ config.output.library = {
128
+ name: prevLibrary,
129
+ type: 'commonjs-module'
130
+ };
131
+ } else {
132
+ config.output.library = {
133
+ type: 'commonjs-module'
134
+ };
135
+ }
120
136
  delete config.output.chunkLoadingGlobal;
121
137
  const UniverseEntryChunkTrackerPluginModule = safeRequire('@module-federation/node/universe-entry-chunk-tracker-plugin');
122
138
  const UniverseEntryChunkTrackerPlugin = UniverseEntryChunkTrackerPluginModule?.default;
@@ -47,6 +47,22 @@ function patchNodeConfig(config, mfConfig) {
47
47
  config.output.module = false;
48
48
  config.output.chunkFormat = 'commonjs';
49
49
  config.output.chunkLoading = 'async-node';
50
+ const prevLibrary = config.output.library;
51
+ if (prevLibrary && typeof prevLibrary === 'object' && !Array.isArray(prevLibrary)) {
52
+ config.output.library = {
53
+ ...prevLibrary,
54
+ type: 'commonjs-module'
55
+ };
56
+ } else if (typeof prevLibrary === 'string' || Array.isArray(prevLibrary)) {
57
+ config.output.library = {
58
+ name: prevLibrary,
59
+ type: 'commonjs-module'
60
+ };
61
+ } else {
62
+ config.output.library = {
63
+ type: 'commonjs-module'
64
+ };
65
+ }
50
66
  delete config.output.chunkLoadingGlobal;
51
67
  const UniverseEntryChunkTrackerPluginModule = safeRequire('@module-federation/node/universe-entry-chunk-tracker-plugin');
52
68
  const UniverseEntryChunkTrackerPlugin = UniverseEntryChunkTrackerPluginModule?.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/rsbuild-plugin",
3
- "version": "2.7.0",
3
+ "version": "2.8.1",
4
4
  "description": "Module Federation plugin for Rsbuild",
5
5
  "homepage": "https://module-federation.io",
6
6
  "bugs": {
@@ -49,15 +49,15 @@
49
49
  "dist"
50
50
  ],
51
51
  "dependencies": {
52
- "@module-federation/sdk": "2.7.0",
53
- "@module-federation/enhanced": "2.7.0",
54
- "@module-federation/node": "2.7.46"
52
+ "@module-federation/sdk": "2.8.1",
53
+ "@module-federation/enhanced": "2.8.1",
54
+ "@module-federation/node": "2.7.48"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@rslib/core": "^0.23.2",
58
58
  "@rsbuild/core": "2.1.4",
59
59
  "@rstest/core": "^0.10.6",
60
- "typescript": "6.0.3"
60
+ "typescript": "7.0.2"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@rsbuild/core": "^1.3.21 || ^2.0.0-0"