zephyr-rsbuild-plugin 0.1.1 → 0.1.2
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/index.d.ts
CHANGED
package/dist/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
2
|
+
import { type ZephyrBuildHooks } from 'zephyr-rspack-plugin';
|
|
2
3
|
export interface ZephyrRsbuildPluginOptions {
|
|
3
4
|
wait_for_index_html?: boolean;
|
|
5
|
+
hooks?: ZephyrBuildHooks;
|
|
4
6
|
}
|
|
5
7
|
export declare function withZephyr(options?: ZephyrRsbuildPluginOptions): RsbuildPlugin;
|
|
@@ -6,8 +6,24 @@ function withZephyr(options) {
|
|
|
6
6
|
return {
|
|
7
7
|
name: 'zephyr-rsbuild-plugin',
|
|
8
8
|
setup(api) {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// Per Rspack team: @module-federation/rsbuild-plugin adds MF plugins in onBeforeCreateCompiler,
|
|
10
|
+
// which runs AFTER modifyRspackConfig. So we must process the configs in onBeforeCreateCompiler
|
|
11
|
+
// where the MF plugins are already present.
|
|
12
|
+
// Using order: 'post' ensures we run after the MF plugin has set up the config.
|
|
13
|
+
api.onBeforeCreateCompiler({
|
|
14
|
+
order: 'post',
|
|
15
|
+
handler: async ({ bundlerConfigs }) => {
|
|
16
|
+
// Process each bundler config (one per environment)
|
|
17
|
+
for (const config of bundlerConfigs) {
|
|
18
|
+
// Apply Zephyr's rspack transformation
|
|
19
|
+
// The real MF plugin is already present in the config and rspackWithZephyr will extract from it
|
|
20
|
+
const result = await (0, zephyr_rspack_plugin_1.withZephyr)(options)(config);
|
|
21
|
+
// Merge result back (rspackWithZephyr may return a new config or void)
|
|
22
|
+
if (result) {
|
|
23
|
+
Object.assign(config, result);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
11
27
|
});
|
|
12
28
|
},
|
|
13
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/rsbuild-plugin/with-zephyr.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/rsbuild-plugin/with-zephyr.ts"],"names":[],"mappings":";;AAWA,gCA0BC;AApCD,+DAG8B;AAO9B,SAAgB,UAAU,CAAC,OAAoC;IAC7D,OAAO;QACL,IAAI,EAAE,uBAAuB;QAC7B,KAAK,CAAC,GAAG;YACP,gGAAgG;YAChG,gGAAgG;YAChG,4CAA4C;YAC5C,gFAAgF;YAChF,GAAG,CAAC,sBAAsB,CAAC;gBACzB,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,KAAK,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE;oBACpC,oDAAoD;oBACpD,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;wBACpC,uCAAuC;wBACvC,gGAAgG;wBAChG,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAgB,EAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;wBAEvD,uEAAuE;wBACvE,IAAI,MAAM,EAAE,CAAC;4BACX,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;wBAChC,CAAC;oBACH,CAAC;gBACH,CAAC;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-rsbuild-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Rsbuild plugin for Zephyr",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"types": "dist/index.d.ts",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@rsbuild/core": "^1.3.22",
|
|
20
|
-
"zephyr-rspack-plugin": "0.1.
|
|
20
|
+
"zephyr-rspack-plugin": "0.1.2"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/jest": "29.5.14",
|