Skip to content

Commit

Permalink
docs: update ice3 doc about ice2 main app and ice3 sub app (#6905)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkgkn authored Jun 13, 2024
1 parent bd2347a commit 41498f0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions website/docs/guide/advanced/icestark.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ export default defineConfig(() => ({
}));
```

但如果你的主应用是ice2,微应用是ice3,记得在ice3微应用的入口文件,通常是 app.tsx 文件中,调用 @ice/stark-app 中的 `setLibraryName` 方法,设置子应用模块的全局变量名称,通常是 package.json 中的 `name`
```ts
import {setLibraryName} from '@ice/stark-app';

setLibraryName('microName');

// ...其他app.tsx的代码,如export mount, export unmount等等

```

应用入口可以配置相关生命周期执行行为(可选):

```ts title="ice.config.mts"
Expand Down

0 comments on commit 41498f0

Please sign in to comment.