Skip to content

Commit 41498f0

Browse files
authored
docs: update ice3 doc about ice2 main app and ice3 sub app (#6905)
1 parent bd2347a commit 41498f0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

website/docs/guide/advanced/icestark.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ export default defineConfig(() => ({
9696
}));
9797
```
9898

99+
但如果你的主应用是ice2,微应用是ice3,记得在ice3微应用的入口文件,通常是 app.tsx 文件中,调用 @ice/stark-app 中的 `setLibraryName` 方法,设置子应用模块的全局变量名称,通常是 package.json 中的 `name`
100+
```ts
101+
import {setLibraryName} from '@ice/stark-app';
102+
103+
setLibraryName('microName');
104+
105+
// ...其他app.tsx的代码,如export mount, export unmount等等
106+
107+
```
108+
99109
应用入口可以配置相关生命周期执行行为(可选):
100110

101111
```ts title="ice.config.mts"

0 commit comments

Comments
 (0)