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 = {
16
16
options : { } ,
17
17
} ,
18
18
addons : [
19
+ {
20
+ name : getAbsolutePath ( 'storybook-addon-rslib' ) ,
21
+ options : {
22
+ rslib : {
23
+ include : [ '**/stories/**' ] ,
24
+ } ,
25
+ } ,
26
+ } ,
19
27
{
20
28
name : '@module-federation/storybook-addon/preset' ,
21
29
options : {
22
30
remotes : {
23
31
'rslib-module' :
24
- 'rslib-module@http://localhost:3000 /mf/mf-manifest.json' ,
32
+ 'rslib-module@http://localhost:3001 /mf/mf-manifest.json' ,
25
33
} ,
26
- shareStrategy : 'loaded-first' ,
27
34
} ,
28
35
} ,
29
36
] ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ Dev package
21
21
1 .
22
22
23
23
```
24
- nx serve rslib-module
24
+ nx dev rslib-module
25
25
```
26
26
27
27
2 .
Original file line number Diff line number Diff line change 13
13
"types" : " ./dist/cjs/index.d.ts" ,
14
14
"scripts" : {
15
15
"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" ,
17
18
"storybook" : " storybook dev -p 6006"
18
19
},
19
20
"devDependencies" : {
20
21
"@module-federation/enhanced" : " workspace:*" ,
21
22
"@module-federation/rsbuild-plugin" : " workspace:*" ,
22
23
"@module-federation/storybook-addon" : " workspace:*" ,
23
24
"@rsbuild/plugin-react" : " ^1.0.6" ,
24
- "@rslib/core" : " ^0.0.14 " ,
25
+ "@rslib/core" : " ^0.0.18 " ,
25
26
"@types/react" : " ^18.3.11" ,
26
27
"http-server" : " ^14.1.1" ,
27
28
"react" : " ^18.3.1" ,
28
29
"react-dom" : " ^18.3.1" ,
29
30
"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"
31
33
},
32
34
"peerDependencies" : {
33
35
"react" : " *"
Original file line number Diff line number Diff line change 23
23
}
24
24
]
25
25
},
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
+ },
26
38
"storybook" : {
27
39
"executor" : " nx:run-commands" ,
28
40
"options" : {
Original file line number Diff line number Diff line change @@ -38,6 +38,13 @@ export default defineConfig({
38
38
assetPrefix : 'http://localhost:3000/mf' ,
39
39
minify : true ,
40
40
} ,
41
+ dev : {
42
+ assetPrefix : 'http://localhost:3001/mf' ,
43
+ } ,
44
+ // just for dev
45
+ server : {
46
+ port : 3001 ,
47
+ } ,
41
48
plugins : [
42
49
pluginModuleFederation ( {
43
50
name : 'rslib_provider' ,
You can’t perform that action at this time.
0 commit comments