From 41498f020dc5d4052f5d3e9e9893c2d4e47b7156 Mon Sep 17 00:00:00 2001 From: tkgkn <690554125@qq.com> Date: Thu, 13 Jun 2024 13:36:49 +0800 Subject: [PATCH] docs: update ice3 doc about ice2 main app and ice3 sub app (#6905) --- website/docs/guide/advanced/icestark.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/website/docs/guide/advanced/icestark.md b/website/docs/guide/advanced/icestark.md index 47fdafd7ea..ade9bb3019 100644 --- a/website/docs/guide/advanced/icestark.md +++ b/website/docs/guide/advanced/icestark.md @@ -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"