File tree Expand file tree Collapse file tree 6 files changed +373
-162
lines changed Expand file tree Collapse file tree 6 files changed +373
-162
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,21 @@ const config: StorybookConfig = {
1616 options : { } ,
1717 } ,
1818 addons : [
19+ {
20+ name : getAbsolutePath ( 'storybook-addon-rslib' ) ,
21+ options : {
22+ rslib : {
23+ include : [ '**/stories/**' ] ,
24+ } ,
25+ } ,
26+ } ,
1927 {
2028 name : '@module-federation/storybook-addon/preset' ,
2129 options : {
2230 remotes : {
2331 'rslib-module' :
24- 'rslib-module@http://localhost:3000 /mf/mf-manifest.json' ,
32+ 'rslib-module@http://localhost:3001 /mf/mf-manifest.json' ,
2533 } ,
26- shareStrategy : 'loaded-first' ,
2734 } ,
2835 } ,
2936 ] ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ Dev package
21211 .
2222
2323```
24- nx serve rslib-module
24+ nx dev rslib-module
2525```
2626
27272 .
Original file line number Diff line number Diff line change 1313 "types" : " ./dist/cjs/index.d.ts" ,
1414 "scripts" : {
1515 "build" : " rslib build" ,
16- "serve" : " pnpm build && http-server -p 3000 ./dist/ --cors" ,
16+ "dev" : " rslib mf dev" ,
17+ "serve" : " pnpm build && http-server -p 3001 ./dist/ --cors" ,
1718 "storybook" : " storybook dev -p 6006"
1819 },
1920 "devDependencies" : {
2021 "@module-federation/enhanced" : " workspace:*" ,
2122 "@module-federation/rsbuild-plugin" : " workspace:*" ,
2223 "@module-federation/storybook-addon" : " workspace:*" ,
2324 "@rsbuild/plugin-react" : " ^1.0.6" ,
24- "@rslib/core" : " ^0.0.14 " ,
25+ "@rslib/core" : " ^0.0.18 " ,
2526 "@types/react" : " ^18.3.11" ,
2627 "http-server" : " ^14.1.1" ,
2728 "react" : " ^18.3.1" ,
2829 "react-dom" : " ^18.3.1" ,
2930 "storybook" : " ^8.3.6" ,
30- "storybook-react-rsbuild" : " ^0.1.1"
31+ "storybook-react-rsbuild" : " ^0.1.1" ,
32+ "storybook-addon-rslib" : " ^0.1.4"
3133 },
3234 "peerDependencies" : {
3335 "react" : " *"
Original file line number Diff line number Diff line change 2323 }
2424 ]
2525 },
26+ "dev" : {
27+ "executor" : " nx:run-commands" ,
28+ "options" : {
29+ "commands" : [" npm run dev --prefix apps/rslib-module" ]
30+ },
31+ "dependsOn" : [
32+ {
33+ "target" : " build" ,
34+ "dependencies" : true
35+ }
36+ ]
37+ },
2638 "storybook" : {
2739 "executor" : " nx:run-commands" ,
2840 "options" : {
Original file line number Diff line number Diff line change @@ -38,6 +38,13 @@ export default defineConfig({
3838 assetPrefix : 'http://localhost:3000/mf' ,
3939 minify : true ,
4040 } ,
41+ dev : {
42+ assetPrefix : 'http://localhost:3001/mf' ,
43+ } ,
44+ // just for dev
45+ server : {
46+ port : 3001 ,
47+ } ,
4148 plugins : [
4249 pluginModuleFederation ( {
4350 name : 'rslib_provider' ,
You can’t perform that action at this time.
0 commit comments