@module-federation/rspress-plugin 2.0.1 → 2.2.0
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/README.md +1 -1
- package/dist/index.js +23 -5
- package/package.json +8 -6
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { pluginModuleFederation } from "@module-federation/rsbuild-plugin";
|
|
2
|
-
import { BUILD_002, buildDescMap
|
|
2
|
+
import { BUILD_002, buildDescMap } from "@module-federation/error-codes";
|
|
3
|
+
import { logAndReport } from "@module-federation/error-codes/node";
|
|
3
4
|
import { createLogger, createModuleFederationConfig } from "@module-federation/sdk";
|
|
4
5
|
import promises_default from "node:fs/promises";
|
|
5
6
|
import external_node_path_default from "node:path";
|
|
@@ -196,12 +197,20 @@ function plugin_pluginModuleFederation(mfConfig, rspressOptions) {
|
|
|
196
197
|
return {
|
|
197
198
|
name: 'plugin-module-federation',
|
|
198
199
|
async config (config) {
|
|
199
|
-
if (!isDev() && false !== config.ssg)
|
|
200
|
+
if (!isDev() && false !== config.ssg) {
|
|
201
|
+
enableSSG = true;
|
|
202
|
+
if (config.llms) {
|
|
203
|
+
src_logger.info('Detect you set "llms: true", enable experimentalWorker for ssg to enable parallel build');
|
|
204
|
+
config.ssg = {
|
|
205
|
+
...'object' == typeof config.ssg ? config.ssg : {},
|
|
206
|
+
experimentalWorker: true
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
200
210
|
config.builderConfig ||= {};
|
|
201
211
|
config.builderConfig.plugins ||= [];
|
|
202
212
|
config.builderConfig.plugins.push(pluginModuleFederation(mfConfig, {
|
|
203
213
|
target: enableSSG ? 'dual' : 'web',
|
|
204
|
-
environment: 'node',
|
|
205
214
|
ssrDir: 'mf-ssg'
|
|
206
215
|
}));
|
|
207
216
|
return config;
|
|
@@ -212,9 +221,18 @@ function plugin_pluginModuleFederation(mfConfig, rspressOptions) {
|
|
|
212
221
|
rspack (config) {
|
|
213
222
|
if ('node' === config.name) {
|
|
214
223
|
if (('/' === config.output.publicPath || 'auto' === config.output.publicPath) && mfConfig.exposes) {
|
|
215
|
-
|
|
224
|
+
logAndReport(BUILD_002, buildDescMap, {
|
|
216
225
|
publicPath: config.output.publicPath
|
|
217
|
-
})
|
|
226
|
+
}, src_logger.error.bind(src_logger), void 0, {
|
|
227
|
+
bundler: {
|
|
228
|
+
name: 'rsbuild'
|
|
229
|
+
},
|
|
230
|
+
mfConfig: {
|
|
231
|
+
name: mfConfig.name,
|
|
232
|
+
filename: mfConfig.filename,
|
|
233
|
+
exposes: mfConfig.exposes
|
|
234
|
+
}
|
|
235
|
+
});
|
|
218
236
|
process.exit(1);
|
|
219
237
|
}
|
|
220
238
|
outputDir = config.output.path;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/rspress-plugin",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Module Federation plugin for Rspress",
|
|
6
6
|
"keywords": [
|
|
@@ -42,16 +42,18 @@
|
|
|
42
42
|
"html-to-text": "^9.0.5",
|
|
43
43
|
"lodash-es": "^4.17.21",
|
|
44
44
|
"@rspress/shared": "2.0.3",
|
|
45
|
-
"@module-federation/
|
|
46
|
-
"@module-federation/
|
|
47
|
-
"@module-federation/sdk": "2.0
|
|
48
|
-
"@module-federation/error-codes": "2.0
|
|
45
|
+
"@module-federation/enhanced": "2.2.0",
|
|
46
|
+
"@module-federation/rsbuild-plugin": "2.2.0",
|
|
47
|
+
"@module-federation/sdk": "2.2.0",
|
|
48
|
+
"@module-federation/error-codes": "2.2.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@rspress/core": "^2.0.3"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "rslib build",
|
|
55
|
-
"build:watch": "rslib build --watch"
|
|
55
|
+
"build:watch": "rslib build --watch",
|
|
56
|
+
"dev": "pnpm run build:watch",
|
|
57
|
+
"pre-release": "pnpm exec turbo run build --filter=@module-federation/webpack-bundler-runtime"
|
|
56
58
|
}
|
|
57
59
|
}
|