From 7a08faff5d5f90e207b00eac426e1cc9f70e4698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=AC=E6=B5=B7?= <445436867@qq.com> Date: Tue, 29 Nov 2022 11:12:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20qiankun=E6=8F=92=E4=BB=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81vite=20(#157)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: qiankun支持vite * fix: 优化根据meta创建qiankun子路由逻辑 * refactor: 优化模板代码 --- docs/reference/plugin/plugins/qiankun.md | 22 +- .../fes-plugin-qiankun/examples/micro/.fes.js | 10 - .../examples/vite-main/.fes.js | 63 ++++-- .../examples/vite-main/package.json | 4 +- .../examples/vite-main/src/app.jsx | 2 +- .../examples/vite-main/src/pages/index.vue | 36 ++-- .../vite-main/src/pages/micro/index.vue | 7 - .../vite-main/src/pages/micro/test.vue | 7 - .../vite-main/src/pages/vite/index.vue | 7 + .../vite-main/src/pages/vite/test.vue | 7 + .../vite-main/src/pages/webpack/index.vue | 7 + .../vite-main/src/pages/webpack/test.vue | 7 + .../examples/{micro => vite-micro}/.env | 0 .../examples/vite-micro/index.html | 17 ++ .../examples/vite-micro/package.json | 51 +++++ .../src/app.js => vite-micro/src/app.jsx} | 8 +- .../src/components/PageLoading.vue | 0 .../examples/vite-micro/src/global.css | 3 + .../{micro => vite-micro}/src/images/icon.png | Bin .../src/pages/vite}/index.vue | 5 +- .../src/pages/vite}/test.vue | 5 +- .../{micro => vite-micro}/tsconfig.json | 0 .../examples/webpack-main/.env | 2 +- .../examples/webpack-main/.fes.js | 62 ++++-- .../examples/webpack-main/package.json | 2 +- .../examples/webpack-main/src/pages/index.vue | 35 ++-- .../webpack-main/src/pages/micro/index.vue | 7 - .../webpack-main/src/pages/micro/test.vue | 7 - .../webpack-main/src/pages/vite/index.vue | 7 + .../webpack-main/src/pages/vite/test.vue | 7 + .../webpack-main/src/pages/webpack/index.vue | 7 + .../webpack-main/src/pages/webpack/test.vue | 7 + .../examples/webpack-micro/.env | 1 + .../{micro => webpack-micro}/package.json | 2 +- .../examples/webpack-micro/src/app.js | 31 +++ .../src/components/PageLoading.vue | 29 +++ .../{micro => webpack-micro}/src/global.css | 0 .../webpack-micro/src/images/icon.png | Bin 0 -> 5586 bytes .../webpack-micro/src/pages/webpack/index.vue | 18 ++ .../webpack-micro/src/pages/webpack/test.vue | 18 ++ .../examples/webpack-micro/tsconfig.json | 37 ++++ packages/fes-plugin-qiankun/package.json | 6 +- packages/fes-plugin-qiankun/src/main/index.js | 8 - .../src/main/modifyRoutes.js | 67 +++--- .../main/runtime/MicroAppRouteComponent.tpl | 11 + .../runtime/getMicroAppRouteComponent.jsx | 6 - .../fes-plugin-qiankun/src/micro/index.js | 192 +++++++++++------- .../runtime/{lifecycles.tpl => lifecycle.tpl} | 0 .../src/micro/runtime/runtime.tpl | 2 +- yarn.lock | 102 +++++++++- 50 files changed, 667 insertions(+), 274 deletions(-) delete mode 100644 packages/fes-plugin-qiankun/examples/micro/.fes.js delete mode 100644 packages/fes-plugin-qiankun/examples/vite-main/src/pages/micro/index.vue delete mode 100644 packages/fes-plugin-qiankun/examples/vite-main/src/pages/micro/test.vue create mode 100644 packages/fes-plugin-qiankun/examples/vite-main/src/pages/vite/index.vue create mode 100644 packages/fes-plugin-qiankun/examples/vite-main/src/pages/vite/test.vue create mode 100644 packages/fes-plugin-qiankun/examples/vite-main/src/pages/webpack/index.vue create mode 100644 packages/fes-plugin-qiankun/examples/vite-main/src/pages/webpack/test.vue rename packages/fes-plugin-qiankun/examples/{micro => vite-micro}/.env (100%) create mode 100644 packages/fes-plugin-qiankun/examples/vite-micro/index.html create mode 100644 packages/fes-plugin-qiankun/examples/vite-micro/package.json rename packages/fes-plugin-qiankun/examples/{micro/src/app.js => vite-micro/src/app.jsx} (73%) rename packages/fes-plugin-qiankun/examples/{micro => vite-micro}/src/components/PageLoading.vue (100%) create mode 100644 packages/fes-plugin-qiankun/examples/vite-micro/src/global.css rename packages/fes-plugin-qiankun/examples/{micro => vite-micro}/src/images/icon.png (100%) rename packages/fes-plugin-qiankun/examples/{micro/src/pages/micro => vite-micro/src/pages/vite}/index.vue (72%) rename packages/fes-plugin-qiankun/examples/{micro/src/pages/micro => vite-micro/src/pages/vite}/test.vue (72%) rename packages/fes-plugin-qiankun/examples/{micro => vite-micro}/tsconfig.json (100%) delete mode 100644 packages/fes-plugin-qiankun/examples/webpack-main/src/pages/micro/index.vue delete mode 100644 packages/fes-plugin-qiankun/examples/webpack-main/src/pages/micro/test.vue create mode 100644 packages/fes-plugin-qiankun/examples/webpack-main/src/pages/vite/index.vue create mode 100644 packages/fes-plugin-qiankun/examples/webpack-main/src/pages/vite/test.vue create mode 100644 packages/fes-plugin-qiankun/examples/webpack-main/src/pages/webpack/index.vue create mode 100644 packages/fes-plugin-qiankun/examples/webpack-main/src/pages/webpack/test.vue create mode 100644 packages/fes-plugin-qiankun/examples/webpack-micro/.env rename packages/fes-plugin-qiankun/examples/{micro => webpack-micro}/package.json (97%) create mode 100644 packages/fes-plugin-qiankun/examples/webpack-micro/src/app.js create mode 100644 packages/fes-plugin-qiankun/examples/webpack-micro/src/components/PageLoading.vue rename packages/fes-plugin-qiankun/examples/{micro => webpack-micro}/src/global.css (100%) create mode 100644 packages/fes-plugin-qiankun/examples/webpack-micro/src/images/icon.png create mode 100644 packages/fes-plugin-qiankun/examples/webpack-micro/src/pages/webpack/index.vue create mode 100644 packages/fes-plugin-qiankun/examples/webpack-micro/src/pages/webpack/test.vue create mode 100644 packages/fes-plugin-qiankun/examples/webpack-micro/tsconfig.json create mode 100644 packages/fes-plugin-qiankun/src/main/runtime/MicroAppRouteComponent.tpl delete mode 100644 packages/fes-plugin-qiankun/src/main/runtime/getMicroAppRouteComponent.jsx rename packages/fes-plugin-qiankun/src/micro/runtime/{lifecycles.tpl => lifecycle.tpl} (100%) diff --git a/docs/reference/plugin/plugins/qiankun.md b/docs/reference/plugin/plugins/qiankun.md index 06c98428..57a373f0 100644 --- a/docs/reference/plugin/plugins/qiankun.md +++ b/docs/reference/plugin/plugins/qiankun.md @@ -42,6 +42,11 @@ export default { }; ``` +当使用 `vite` 构建时需注意,**name** 必须跟子应用 `package.json`的 `name`保持一致。 + + + + ### 第二步:装载子应用 #### 使用路由绑定的方式 @@ -72,7 +77,7 @@ export default { } ``` 我们现在想在 `/son` 加载子应用 `app1`,只需要增加这样一些配置即可: -```js {16-23} +```js {16-21} export default { router: { routes: [{ @@ -92,8 +97,6 @@ export default { "path": "/son", "meta": { "name": "son", - "title": "子应用", - "microApp": "app1" } } ] @@ -101,7 +104,7 @@ export default { } } ``` -当前我们依然提倡约定路由的方式,在`src/pages` 目录新建 `son.vue`: +在`src/pages` 目录新建 `son.vue`: ```vue { @@ -172,6 +175,17 @@ export default { }; ``` +如果使用 `vite` 构建,当执行 `dev` 时需要额外配置: +```js +export default { + qiankun: { + micro: { + useDevMode: true + }, + } +}; +``` + ### 第二步:配置运行时生命周期钩子(可选) 插件会自动为你创建好 `qiankun` 子应用需要的生命周期钩子,但是如果你想在生命周期期间加一些自定义逻辑,可以在子应用的 `src/app.js` 里导出 `qiankun` 对象,并实现每一个生命周期钩子,其中钩子函数的入参 `props` 由主应用自动注入。 ```js diff --git a/packages/fes-plugin-qiankun/examples/micro/.fes.js b/packages/fes-plugin-qiankun/examples/micro/.fes.js deleted file mode 100644 index 42588498..00000000 --- a/packages/fes-plugin-qiankun/examples/micro/.fes.js +++ /dev/null @@ -1,10 +0,0 @@ -// .fes.js 只负责管理编译时配置,只能使用plain Object -export default { - qiankun: { - micro: {} - }, - plugins: [ - require.resolve('../../../fes-plugin-model/lib'), - require.resolve('../../../fes-plugin-qiankun/lib'), - ] -}; diff --git a/packages/fes-plugin-qiankun/examples/vite-main/.fes.js b/packages/fes-plugin-qiankun/examples/vite-main/.fes.js index 9789c5c2..57b40844 100644 --- a/packages/fes-plugin-qiankun/examples/vite-main/.fes.js +++ b/packages/fes-plugin-qiankun/examples/vite-main/.fes.js @@ -1,38 +1,59 @@ // .fes.js 只负责管理编译时配置,只能使用plain Object - export default { access: { roles: { - admin: ["*"] - } + admin: ['*'], + }, }, layout: { - title: "Fes.js", + title: 'vite 主应用', footer: 'Created by MumbleFE', multiTabs: false, navigation: 'mixin', - menus: [{ - name: 'index', - }, { - title: "子应用", - children: [{ - name: 'micro-index' - },{ - name: 'micro-test' - }] - }] + menus: [ + { + name: 'index', + }, + { + title: 'webpack子应用', + children: [ + { + name: 'webpack-micro-index', + }, + { + name: 'webpack-micro-test', + }, + ], + }, + { + title: 'vite子应用', + children: [ + { + name: 'vite-micro-index', + }, + { + name: 'vite-micro-test', + }, + ], + }, + ], }, qiankun: { main: { apps: [ { - name: 'micro', // 唯一 id + name: 'webpack-micro', // 唯一 id + entry: '//localhost:9001', // html entry + props: {}, // 传递给子应用的数据 + }, + { + name: 'vite-micro', // 唯一 id entry: '//localhost:8001', // html entry - props: {} // 传递给子应用的数据 - } - ] - } + props: {}, // 传递给子应用的数据 + }, + ], + }, }, plugins: [ require.resolve('../../../fes-plugin-model/lib'), @@ -40,7 +61,5 @@ export default { require.resolve('../../../fes-plugin-access/lib'), require.resolve('../../../fes-plugin-qiankun/lib'), ], - presets: [ - require.resolve('../../../fes-builder-vite/lib'), - ] + presets: [require.resolve('../../../fes-builder-vite/lib')], }; diff --git a/packages/fes-plugin-qiankun/examples/vite-main/package.json b/packages/fes-plugin-qiankun/examples/vite-main/package.json index 74e3c661..aa5f906c 100644 --- a/packages/fes-plugin-qiankun/examples/vite-main/package.json +++ b/packages/fes-plugin-qiankun/examples/vite-main/package.json @@ -1,5 +1,5 @@ { - "name": "main", + "name": "vite-main", "version": "2.0.0", "description": "fes项目模版", "scripts": { @@ -43,8 +43,8 @@ "access": "public" }, "dependencies": { - "@fesjs/fes": "^2.0.0", "vue": "^3.2.37", + "@fesjs/fes": "^2.0.0", "@fesjs/fes-design": "^0.7.0" }, "private": true diff --git a/packages/fes-plugin-qiankun/examples/vite-main/src/app.jsx b/packages/fes-plugin-qiankun/examples/vite-main/src/app.jsx index a942f014..f1f82077 100644 --- a/packages/fes-plugin-qiankun/examples/vite-main/src/app.jsx +++ b/packages/fes-plugin-qiankun/examples/vite-main/src/app.jsx @@ -9,7 +9,7 @@ export const beforeRender = { setTimeout(() => { setRole('admin'); resolve(); - }, 1000); + }, 100); }); }, }; diff --git a/packages/fes-plugin-qiankun/examples/vite-main/src/pages/index.vue b/packages/fes-plugin-qiankun/examples/vite-main/src/pages/index.vue index 60251284..5fd847bb 100644 --- a/packages/fes-plugin-qiankun/examples/vite-main/src/pages/index.vue +++ b/packages/fes-plugin-qiankun/examples/vite-main/src/pages/index.vue @@ -1,17 +1,18 @@ { @@ -20,22 +21,15 @@ } - - diff --git a/packages/fes-plugin-qiankun/examples/micro/src/pages/micro/test.vue b/packages/fes-plugin-qiankun/examples/vite-micro/src/pages/vite/test.vue similarity index 72% rename from packages/fes-plugin-qiankun/examples/micro/src/pages/micro/test.vue rename to packages/fes-plugin-qiankun/examples/vite-micro/src/pages/vite/test.vue index 33504e20..caac05fb 100644 --- a/packages/fes-plugin-qiankun/examples/micro/src/pages/micro/test.vue +++ b/packages/fes-plugin-qiankun/examples/vite-micro/src/pages/vite/test.vue @@ -1,6 +1,5 @@ { @@ -17,5 +16,3 @@ export default { }, }; - - diff --git a/packages/fes-plugin-qiankun/examples/micro/tsconfig.json b/packages/fes-plugin-qiankun/examples/vite-micro/tsconfig.json similarity index 100% rename from packages/fes-plugin-qiankun/examples/micro/tsconfig.json rename to packages/fes-plugin-qiankun/examples/vite-micro/tsconfig.json diff --git a/packages/fes-plugin-qiankun/examples/webpack-main/.env b/packages/fes-plugin-qiankun/examples/webpack-main/.env index 25241b73..00ee76b1 100644 --- a/packages/fes-plugin-qiankun/examples/webpack-main/.env +++ b/packages/fes-plugin-qiankun/examples/webpack-main/.env @@ -1 +1 @@ -PORT=8080 +PORT=9000 diff --git a/packages/fes-plugin-qiankun/examples/webpack-main/.fes.js b/packages/fes-plugin-qiankun/examples/webpack-main/.fes.js index e7fc5d91..ed94237f 100644 --- a/packages/fes-plugin-qiankun/examples/webpack-main/.fes.js +++ b/packages/fes-plugin-qiankun/examples/webpack-main/.fes.js @@ -2,35 +2,57 @@ export default { access: { roles: { - admin: ["*"] - } + admin: ['*'], + }, }, layout: { - title: "Fes.js", + title: 'webpack 主应用', footer: 'Created by MumbleFE', multiTabs: false, navigation: 'mixin', - menus: [{ - name: 'index', - }, { - title: "子应用1", - children: [{ - name: 'micro-index' - },{ - name: 'micro-test' - }] - }] + menus: [ + { + name: 'index', + }, + { + title: 'webpack子应用', + children: [ + { + name: 'webpack-micro-index', + }, + { + name: 'webpack-micro-test', + }, + ], + }, + { + title: 'vite子应用', + children: [ + { + name: 'vite-micro-index', + }, + { + name: 'vite-micro-test', + }, + ], + }, + ], }, qiankun: { main: { apps: [ { - name: 'micro', // 唯一 id + name: 'webpack-micro', // 唯一 id + entry: '//localhost:9001', // html entry + props: {}, // 传递给子应用的数据 + }, + { + name: 'vite-micro', // 唯一 id entry: '//localhost:8001', // html entry - props: {} // 传递给子应用的数据 - } - ] - } + props: {}, // 传递给子应用的数据 + }, + ], + }, }, plugins: [ require.resolve('../../../fes-plugin-model/lib'), @@ -38,7 +60,5 @@ export default { require.resolve('../../../fes-plugin-access/lib'), require.resolve('../../../fes-plugin-qiankun/lib'), ], - presets: [ - require.resolve('../../../fes-builder-webpack/lib'), - ] + presets: [require.resolve('../../../fes-builder-webpack/lib')], }; diff --git a/packages/fes-plugin-qiankun/examples/webpack-main/package.json b/packages/fes-plugin-qiankun/examples/webpack-main/package.json index 74e3c661..1eea9b20 100644 --- a/packages/fes-plugin-qiankun/examples/webpack-main/package.json +++ b/packages/fes-plugin-qiankun/examples/webpack-main/package.json @@ -1,5 +1,5 @@ { - "name": "main", + "name": "webpack-main", "version": "2.0.0", "description": "fes项目模版", "scripts": { diff --git a/packages/fes-plugin-qiankun/examples/webpack-main/src/pages/index.vue b/packages/fes-plugin-qiankun/examples/webpack-main/src/pages/index.vue index d7c6f581..5fd847bb 100644 --- a/packages/fes-plugin-qiankun/examples/webpack-main/src/pages/index.vue +++ b/packages/fes-plugin-qiankun/examples/webpack-main/src/pages/index.vue @@ -1,16 +1,18 @@ { @@ -19,22 +21,15 @@ } + diff --git a/packages/fes-plugin-qiankun/examples/micro/src/global.css b/packages/fes-plugin-qiankun/examples/webpack-micro/src/global.css similarity index 100% rename from packages/fes-plugin-qiankun/examples/micro/src/global.css rename to packages/fes-plugin-qiankun/examples/webpack-micro/src/global.css diff --git a/packages/fes-plugin-qiankun/examples/webpack-micro/src/images/icon.png b/packages/fes-plugin-qiankun/examples/webpack-micro/src/images/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ff46a842d654da25a975ac545798bbcc4fd57918 GIT binary patch literal 5586 zcmb_gXE>Zq+rD>|u!x@MRwu$LNf5*mEzzP!FRLsOEqc9mtJj2t<?%``J0I(O{(^NMLvHx8h*~k+Z+S@Vg1*C9lzf|_;(u(`lpy>3vE+DdtqhCOk_XC>_>vXCE7JtNqv)gxQT_JN=WuTS1w!fXr+6FjfDniPS96)ryWjQB^-;;py|Yw}^`gFcFYmhSWb!>YAqRt?ObFAr86qLCWC$+n z2lgt85SM1Y4?}pvzaGm;oe&~l5-(qSY|}Tuk7&58dO1q8Ok}1t_llbQMLtT4vN8)S zFgOqd_%E$|6TBR`h^1wuc(^?N3eULt!Y@e!;(Tk`$C-i-b7aR^VsmX(ek8cB*BNhr zQ{xY5{dGC zf3C*)S-J3d%I){ z^*>xsT*Ax&^v90&m#Qrt-uvrduHKQCLlNu)weX_BV8Lf=LSHFD&eu60R9K?}#`NZC zoj`|Q^1WJs5-Hdxl$=q?h=^|jn}dt zJhtUC`$Pq=8sn0h{gBYYAE{YxUnggDAQwLVEEK6<9m(4HNBNzdEMX=G+|jGe2s8l(}(YjuNV zZTEiVbTECLBb;UoY40Q8BvJGQ=$Zk*#QWWrNcTSGr9f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fj=i+>el;jUI+JNXC)l$l`C&-yipn`_|Rz!y-fOGpp*L;u*l9dKi6D&I@GsUcl%1M zsR6VP9HVK{kjy_-8i)|(sE%QZG97|ENs@CvrH&6zUVrU9`S7jld1J4}M~RwTfW`06 zf5ewFd1OF~XeZ^#qtmoxk|@#W)=d6QW}EActpLmJp_p==he(;};+TGC2`wz@LyFQM z$@eSt4d3GapH{{ohL!W{uPh4Eu6)vDN9K&|e>BDiG4f%N@|<&p^eC=Q1j>3_k(E9y3r0Pgoe7zu61mYMxWTY0heQ(~Btn^iD zIzMnBBL$5d!nSHbVANDlR=k0X%&tbX9hf134T)?HHY+l+Z|vE8_%%4Vm#0gg@`|hp ve&5jBQY9M?yDv +
webpack - micro - index
+ + +{ + "name": "index", + "title": "home" +} + + diff --git a/packages/fes-plugin-qiankun/examples/webpack-micro/src/pages/webpack/test.vue b/packages/fes-plugin-qiankun/examples/webpack-micro/src/pages/webpack/test.vue new file mode 100644 index 00000000..bf79569b --- /dev/null +++ b/packages/fes-plugin-qiankun/examples/webpack-micro/src/pages/webpack/test.vue @@ -0,0 +1,18 @@ + + +{ + "name": "test", + "title": "test" +} + + diff --git a/packages/fes-plugin-qiankun/examples/webpack-micro/tsconfig.json b/packages/fes-plugin-qiankun/examples/webpack-micro/tsconfig.json new file mode 100644 index 00000000..ea930c0b --- /dev/null +++ b/packages/fes-plugin-qiankun/examples/webpack-micro/tsconfig.json @@ -0,0 +1,37 @@ +{ + "compilerOptions": { + "outDir": "build/dist", + "module": "esnext", + "target": "esnext", + "lib": ["esnext", "dom"], + "sourceMap": true, + "baseUrl": ".", + "jsx": "preserve", + "allowSyntheticDefaultImports": true, + "moduleResolution": "node", + "forceConsistentCasingInFileNames": true, + "noImplicitReturns": true, + "suppressImplicitAnyIndexErrors": true, + "noUnusedLocals": true, + "allowJs": true, + "skipLibCheck": true, + "experimentalDecorators": true, + "strict": true, + "paths": { + "@/*": ["./src/*"], + "@@/*": ["./src/.fes/*"] + } + }, + "include": [ + "src/**/*", + "tests/**/*", + "test/**/*", + "__test__/**/*", + "typings/**/*", + "config/**/*", + ".eslintrc.js", + ".stylelintrc.js", + ".prettierrc.js" + ], + "exclude": ["node_modules", "build", "dist", "scripts", "src/.fes/*", "webpack", "jest"] +} diff --git a/packages/fes-plugin-qiankun/package.json b/packages/fes-plugin-qiankun/package.json index e3572aa5..c3464487 100644 --- a/packages/fes-plugin-qiankun/package.json +++ b/packages/fes-plugin-qiankun/package.json @@ -10,8 +10,9 @@ "scripts": { "start": "npm-run-all --parallel start:*", "start:vite-main": "cd ./examples/vite-main && fes dev", + "start:vite-micro": "cd ./examples/vite-micro && fes dev", "start:webpack-main": "cd ./examples/webpack-main && fes dev", - "start:micro": "cd ./examples/micro && fes dev" + "start:webpack-micro": "cd ./examples/webpack-micro && fes dev" }, "repository": { "type": "git", @@ -34,7 +35,8 @@ "@fesjs/utils": "3.0.0-rc.2", "address": "^1.1.2", "lodash-es": "^4.17.15", - "qiankun": "^2.7.0" + "qiankun": "^2.7.0", + "vite-plugin-qiankun": "^1.0.15" }, "devDependencies": { "npm-run-all": "^4.1.5" diff --git a/packages/fes-plugin-qiankun/src/main/index.js b/packages/fes-plugin-qiankun/src/main/index.js index b741733e..74b4b6be 100644 --- a/packages/fes-plugin-qiankun/src/main/index.js +++ b/packages/fes-plugin-qiankun/src/main/index.js @@ -30,7 +30,6 @@ export default function (api) { const absMicroAppWithMemoHistoryPath = join(namespace, 'MicroAppWithMemoHistory.jsx'); const absRuntimePath = join(namespace, 'runtime.js'); const absMasterOptionsPath = join(namespace, 'masterOptions.js'); - const absGetMicroAppRouteCompPath = join(namespace, 'getMicroAppRouteComponent.jsx'); api.onGenerateFiles(() => { const HAS_PLUGIN_MODEL = api.hasPlugins(['@fesjs/plugin-model']); @@ -85,11 +84,4 @@ export default function (api) { source: absMicroAppWithMemoHistoryPath, }, ]); - - api.addPluginExports(() => [ - { - specifiers: ['getMicroAppRouteComponent'], - source: absGetMicroAppRouteCompPath, - }, - ]); } diff --git a/packages/fes-plugin-qiankun/src/main/modifyRoutes.js b/packages/fes-plugin-qiankun/src/main/modifyRoutes.js index 9435fde2..6aee94fc 100644 --- a/packages/fes-plugin-qiankun/src/main/modifyRoutes.js +++ b/packages/fes-plugin-qiankun/src/main/modifyRoutes.js @@ -1,44 +1,36 @@ +import { join } from 'path'; +import { readFileSync } from 'fs'; import { defaultHistoryType } from '../constants'; -function getMicroApp(options) { - const { key, microAppName, cacheName, masterHistoryType, base, namespace, ...normalizedRouteProps } = options; - return `(async () => { -const { getMicroAppRouteComponent } = await import('@@/${namespace}/getMicroAppRouteComponent'); -return getMicroAppRouteComponent({key: '${key}', appName: '${microAppName}', cacheName: '${cacheName}', base: '${base}', masterHistoryType: '${masterHistoryType}', routeProps: ${JSON.stringify( - normalizedRouteProps, - )} }) -})()`; -} +let index = 0; -function modifyRoutesWithAttachMode({ routes, masterHistoryType, base, namespace }) { - const patchRoutes = (_routes) => { - if (_routes.length) { - _routes.forEach((route) => { - if (route.meta && route.meta.microApp) { - route.component = getMicroApp({ - key: route.path, - cacheName: route.meta.cacheName ?? route.path, - microAppName: route.meta.microApp, - masterHistoryType, - base, - namespace, - }); - } - if (route.children?.length) { - modifyRoutesWithAttachMode({ - routes: route.children, - masterHistoryType, - base, - namespace, - }); - } +function modifyRoutesWithAttachMode({ routes, api, namespace, masterHistoryType, base }) { + if (!routes.length) return; + routes.forEach((route) => { + if (route.meta && route.meta.microApp) { + const fileName = `MicroAppRouteComponent${index++}.vue`; + route.component = `@@/${namespace}/${fileName}`; + api.writeTmpFile({ + path: join(namespace, fileName), + content: api.utils.Mustache.render(readFileSync(join(__dirname, 'runtime/MicroAppRouteComponent.tpl'), 'utf-8'), { + cacheName: route.meta.cacheName ?? route.path, + microAppName: route.meta.microApp, + masterHistoryType, + base, + namespace, + }), }); } - }; - - patchRoutes(routes); - - return routes; + if (route.children?.length) { + modifyRoutesWithAttachMode({ + routes: route.children, + api, + namespace, + masterHistoryType, + base, + }); + } + }); } export default function modifyRoutes({ api, namespace }) { @@ -47,10 +39,11 @@ export default function modifyRoutes({ api, namespace }) { const masterHistoryType = (router && router.mode) || defaultHistoryType; modifyRoutesWithAttachMode({ + api, + namespace, routes, masterHistoryType, base: base || '/', - namespace, }); return routes; diff --git a/packages/fes-plugin-qiankun/src/main/runtime/MicroAppRouteComponent.tpl b/packages/fes-plugin-qiankun/src/main/runtime/MicroAppRouteComponent.tpl new file mode 100644 index 00000000..6449e698 --- /dev/null +++ b/packages/fes-plugin-qiankun/src/main/runtime/MicroAppRouteComponent.tpl @@ -0,0 +1,11 @@ + + diff --git a/packages/fes-plugin-qiankun/src/main/runtime/getMicroAppRouteComponent.jsx b/packages/fes-plugin-qiankun/src/main/runtime/getMicroAppRouteComponent.jsx deleted file mode 100644 index bbdc78cc..00000000 --- a/packages/fes-plugin-qiankun/src/main/runtime/getMicroAppRouteComponent.jsx +++ /dev/null @@ -1,6 +0,0 @@ -// eslint-disable-next-line import/extensions -import { MicroApp } from './MicroApp'; - -export function getMicroAppRouteComponent({ key, appName, base, masterHistoryType, routeProps, cacheName }) { - return ; -} diff --git a/packages/fes-plugin-qiankun/src/micro/index.js b/packages/fes-plugin-qiankun/src/micro/index.js index 5bf16a4c..d8463032 100644 --- a/packages/fes-plugin-qiankun/src/micro/index.js +++ b/packages/fes-plugin-qiankun/src/micro/index.js @@ -1,7 +1,8 @@ import assert from 'assert'; -import { lodash } from '@fesjs/utils'; import { readFileSync } from 'fs'; import { join } from 'path'; +import { lodash } from '@fesjs/utils'; +import vitePluginQiankun from 'vite-plugin-qiankun'; import { qiankunStateFromMainModelNamespace } from '../constants'; const namespace = 'plugin-qiankun/micro'; @@ -19,70 +20,131 @@ export default function (api) { enableBy: () => isSlaveEnable(api), }); - if (api.builder.name === 'vite') { - // 处理 - } else { - api.modifyDefaultConfig((memo) => { - const initialMicroOptions = { - devSourceMap: true, - ...JSON.parse(process.env.INITIAL_QIANKUN_MIRCO_OPTIONS || '{}'), - ...(memo.qiankun || {}).micro, - }; - const modifiedDefaultConfig = { - ...memo, - qiankun: { - ...memo.qiankun, - slave: initialMicroOptions, - }, - }; + api.modifyDefaultConfig((memo) => { + const initialMicroOptions = { + devSourceMap: true, + ...JSON.parse(process.env.INITIAL_QIANKUN_MICRO_OPTIONS || '{}'), + ...(memo.qiankun || {}).micro, + }; + const modifiedDefaultConfig = { + ...memo, + qiankun: { + ...memo.qiankun, + micro: initialMicroOptions, + }, + }; - const shouldNotModifyDefaultBase = api.userConfig.qiankun?.slave?.shouldNotModifyDefaultBase ?? initialMicroOptions.shouldNotModifyDefaultBase; - if (!shouldNotModifyDefaultBase) { - modifiedDefaultConfig.router.base = `/${api.pkg.name}`; + const shouldNotModifyDefaultBase = api.userConfig.qiankun?.micro?.shouldNotModifyDefaultBase ?? initialMicroOptions.shouldNotModifyDefaultBase; + if (!shouldNotModifyDefaultBase) { + modifiedDefaultConfig.router.base = `/${api.pkg.name}`; + } + + return modifiedDefaultConfig; + }); + + const absRuntimePath = join(namespace, 'runtime.js'); + const absLifecyclePath = join(namespace, 'lifecycle.js'); + const absMicroOptionsPath = join(namespace, 'slaveOptions.js'); + const absModelPath = join(namespace, 'qiankunModel.js'); + + api.register({ + key: 'addExtraModels', + fn: () => { + if (api.hasPlugins(['@fesjs/plugin-model'])) { + return [ + { + absPath: `@@/${absModelPath}`, + namespace: qiankunStateFromMainModelNamespace, + }, + ]; } + return []; + }, + }); - return modifiedDefaultConfig; + api.onGenerateFiles(() => { + const HAS_PLUGIN_MODEL = api.hasPlugins(['@fesjs/plugin-model']); + + api.writeTmpFile({ + path: absRuntimePath, + content: readFileSync(join(__dirname, 'runtime/runtime.tpl'), 'utf-8'), }); - const absRuntimePath = join(namespace, 'runtime.js'); - const absLifecyclesPath = join(namespace, 'lifecycles.js'); - const absMicroOptionsPath = join(namespace, 'slaveOptions.js'); + api.writeTmpFile({ + path: absLifecyclePath, + content: Mustache.render(readFileSync(join(__dirname, 'runtime/lifecycle.tpl'), 'utf-8'), { + HAS_PLUGIN_MODEL, + }), + }); + + api.writeTmpFile({ + path: absMicroOptionsPath, + content: ` + let options = ${JSON.stringify((api.config.qiankun || {}).micro || {})}; + export const getSlaveOptions = () => options; + export const setSlaveOptions = (newOpts) => options = ({ ...options, ...newOpts }); + `, + }); + + if (HAS_PLUGIN_MODEL) { + api.writeTmpFile({ + path: absModelPath, + content: readFileSync(join(__dirname, 'runtime/qiankunModel.tpl'), 'utf-8'), + }); + } + }); + + api.addRuntimePlugin(() => `@@/${absRuntimePath}`); + + if (api.builder.name === 'vite') { + // 处理 + api.modifyBundleConfig((memo) => { + assert(api.pkg.name, 'You should have name in package.json'); + memo.plugins.push( + vitePluginQiankun(api.pkg.name, { + useDevMode: api.config.qiankun?.micro?.useDevMode, + }), + ); + return memo; + }); + + api.addEntryImports(() => ({ + source: `vite-plugin-qiankun/dist/helper`, + specifier: '{ renderWithQiankun, qiankunWindow }', + })); + + api.addEntryImports(() => ({ + source: `@@/${absLifecyclePath}`, + specifier: + '{ genBootstrap as qiankun_genBootstrap, genMount as qiankun_genMount, genUnmount as qiankun_genUnmount, genUpdate as qiankun_genUpdate }', + })); + + api.addEntryCode( + () => ` + const bootstrap = qiankun_genBootstrap(clientRender, app); + const mount = qiankun_genMount('#${api.config.mountElementId}'); + const unmount = qiankun_genUnmount(); + const update = qiankun_genUpdate(); + + renderWithQiankun({ + bootstrap, + mount, + update, + unmount, + }) + + if (!qiankunWindow.__POWERED_BY_QIANKUN__) { + bootstrap().then(mount); + } + `, + ); + } else { const absPublicPath = join(namespace, 'publicPath.js'); - const absModelPath = join(namespace, 'qiankunModel.js'); // 更改public path api.addEntryImportsAhead(() => [{ source: `@@/${absPublicPath}` }]); - api.register({ - key: 'addExtraModels', - fn: () => { - if (api.hasPlugins(['@fesjs/plugin-model'])) { - return [ - { - absPath: `@@/${absModelPath}`, - namespace: qiankunStateFromMainModelNamespace, - }, - ]; - } - return []; - }, - }); - api.onGenerateFiles(() => { - const HAS_PLUGIN_MODEL = api.hasPlugins(['@fesjs/plugin-model']); - - api.writeTmpFile({ - path: absRuntimePath, - content: readFileSync(join(__dirname, 'runtime/runtime.tpl'), 'utf-8'), - }); - - api.writeTmpFile({ - path: absLifecyclesPath, - content: Mustache.render(readFileSync(join(__dirname, 'runtime/lifecycles.tpl'), 'utf-8'), { - HAS_PLUGIN_MODEL, - }), - }); - api.writeTmpFile({ path: absPublicPath, content: ` @@ -92,26 +154,8 @@ export default function (api) { } `, }); - - api.writeTmpFile({ - path: absMicroOptionsPath, - content: ` - let options = ${JSON.stringify((api.config.qiankun || {}).micro || {})}; - export const getSlaveOptions = () => options; - export const setSlaveOptions = (newOpts) => options = ({ ...options, ...newOpts }); - `, - }); - - if (HAS_PLUGIN_MODEL) { - api.writeTmpFile({ - path: absModelPath, - content: readFileSync(join(__dirname, 'runtime/qiankunModel.tpl'), 'utf-8'), - }); - } }); - api.addRuntimePlugin(() => `@@/${absRuntimePath}`); - api.chainWebpack((config) => { assert(api.pkg.name, 'You should have name in package.json'); config.output.libraryTarget('umd').library(`${api.pkg.name}-[name]`); @@ -119,9 +163,9 @@ export default function (api) { }); api.addEntryImports(() => ({ - source: `@@/${absLifecyclesPath}`, + source: `@@/${absLifecyclePath}`, specifier: - '{ genMount as qiankun_genMount, genBootstrap as qiankun_genBootstrap, genUnmount as qiankun_genUnmount, genUpdate as qiankun_genUpdate }', + '{ genBootstrap as qiankun_genBootstrap, genMount as qiankun_genMount, genUnmount as qiankun_genUnmount, genUpdate as qiankun_genUpdate }', })); api.addEntryCode( diff --git a/packages/fes-plugin-qiankun/src/micro/runtime/lifecycles.tpl b/packages/fes-plugin-qiankun/src/micro/runtime/lifecycle.tpl similarity index 100% rename from packages/fes-plugin-qiankun/src/micro/runtime/lifecycles.tpl rename to packages/fes-plugin-qiankun/src/micro/runtime/lifecycle.tpl diff --git a/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl b/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl index 2d620c2c..34a4b5a4 100644 --- a/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl +++ b/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl @@ -1,5 +1,5 @@ import { createMemoryHistory } from '@@/core/coreExports'; -import qiankunRender, { clientRenderOptsStack, history as historyConfig } from './lifecycles'; +import qiankunRender, { clientRenderOptsStack, history as historyConfig } from './lifecycle'; export const render = oldRender => qiankunRender().then(oldRender); diff --git a/yarn.lock b/yarn.lock index 76cdc7a7..ee0a3b99 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3788,6 +3788,31 @@ chardet@^0.7.0: resolved "https://registry.npmmirror.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +cheerio-select@^2.1.0: + version "2.1.0" + resolved "https://registry.npmmirror.com/cheerio-select/-/cheerio-select-2.1.0.tgz#4d8673286b8126ca2a8e42740d5e3c4884ae21b4" + integrity sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g== + dependencies: + boolbase "^1.0.0" + css-select "^5.1.0" + css-what "^6.1.0" + domelementtype "^2.3.0" + domhandler "^5.0.3" + domutils "^3.0.1" + +cheerio@^1.0.0-rc.10: + version "1.0.0-rc.12" + resolved "https://registry.npmmirror.com/cheerio/-/cheerio-1.0.0-rc.12.tgz#788bf7466506b1c6bf5fae51d24a2c4d62e47683" + integrity sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q== + dependencies: + cheerio-select "^2.1.0" + dom-serializer "^2.0.0" + domhandler "^5.0.3" + domutils "^3.0.1" + htmlparser2 "^8.0.1" + parse5 "^7.0.0" + parse5-htmlparser2-tree-adapter "^7.0.0" + "chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.2, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.npmmirror.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" @@ -4419,6 +4444,17 @@ css-select@^4.1.3, css-select@^4.2.1: domutils "^2.8.0" nth-check "^2.0.1" +css-select@^5.1.0: + version "5.1.0" + resolved "https://registry.npmmirror.com/css-select/-/css-select-5.1.0.tgz#b8ebd6554c3637ccc76688804ad3f6a6fdaea8a6" + integrity sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg== + dependencies: + boolbase "^1.0.0" + css-what "^6.1.0" + domhandler "^5.0.2" + domutils "^3.0.1" + nth-check "^2.0.1" + css-tree@^1.1.2, css-tree@^1.1.3: version "1.1.3" resolved "https://registry.npmmirror.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d" @@ -4427,7 +4463,7 @@ css-tree@^1.1.2, css-tree@^1.1.3: mdn-data "2.0.14" source-map "^0.6.1" -css-what@^6.0.1: +css-what@^6.0.1, css-what@^6.1.0: version "6.1.0" resolved "https://registry.npmmirror.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== @@ -4765,7 +4801,16 @@ dom-serializer@^1.0.1: domhandler "^4.2.0" entities "^2.0.0" -domelementtype@^2.0.1, domelementtype@^2.2.0: +dom-serializer@^2.0.0: + version "2.0.0" + resolved "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" + integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.2" + entities "^4.2.0" + +domelementtype@^2.0.1, domelementtype@^2.2.0, domelementtype@^2.3.0: version "2.3.0" resolved "https://registry.npmmirror.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== @@ -4784,6 +4829,13 @@ domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.2.2, domhandler@^4.3.1: dependencies: domelementtype "^2.2.0" +domhandler@^5.0.1, domhandler@^5.0.2, domhandler@^5.0.3: + version "5.0.3" + resolved "https://registry.npmmirror.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" + integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== + dependencies: + domelementtype "^2.3.0" + domutils@^2.5.2, domutils@^2.8.0: version "2.8.0" resolved "https://registry.npmmirror.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" @@ -4793,6 +4845,15 @@ domutils@^2.5.2, domutils@^2.8.0: domelementtype "^2.2.0" domhandler "^4.2.0" +domutils@^3.0.1: + version "3.0.1" + resolved "https://registry.npmmirror.com/domutils/-/domutils-3.0.1.tgz#696b3875238338cb186b6c0612bd4901c89a4f1c" + integrity sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q== + dependencies: + dom-serializer "^2.0.0" + domelementtype "^2.3.0" + domhandler "^5.0.1" + dot-case@^3.0.4: version "3.0.4" resolved "https://registry.npmmirror.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" @@ -4905,6 +4966,11 @@ entities@^3.0.1, entities@~3.0.1: resolved "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4" integrity sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q== +entities@^4.2.0, entities@^4.3.0, entities@^4.4.0: + version "4.4.0" + resolved "https://registry.npmmirror.com/entities/-/entities-4.4.0.tgz#97bdaba170339446495e653cfd2db78962900174" + integrity sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA== + envinfo@^7.7.3, envinfo@^7.8.1: version "7.8.1" resolved "https://registry.npmmirror.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" @@ -6253,6 +6319,16 @@ htmlparser2@^7.1.2: domutils "^2.8.0" entities "^3.0.1" +htmlparser2@^8.0.1: + version "8.0.1" + resolved "https://registry.npmmirror.com/htmlparser2/-/htmlparser2-8.0.1.tgz#abaa985474fcefe269bc761a779b544d7196d010" + integrity sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.2" + domutils "^3.0.1" + entities "^4.3.0" + http-deceiver@^1.2.7: version "1.2.7" resolved "https://registry.npmmirror.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" @@ -8473,6 +8549,14 @@ parse5-htmlparser2-tree-adapter@^6.0.0: dependencies: parse5 "^6.0.1" +parse5-htmlparser2-tree-adapter@^7.0.0: + version "7.0.0" + resolved "https://registry.npmmirror.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz#23c2cc233bcf09bb7beba8b8a69d46b08c62c2f1" + integrity sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g== + dependencies: + domhandler "^5.0.2" + parse5 "^7.0.0" + parse5@6.0.1, parse5@^6.0.1: version "6.0.1" resolved "https://registry.npmmirror.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" @@ -8483,6 +8567,13 @@ parse5@^5.1.1: resolved "https://registry.npmmirror.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== +parse5@^7.0.0: + version "7.1.2" + resolved "https://registry.npmmirror.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" + integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + dependencies: + entities "^4.4.0" + parseurl@~1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.npmmirror.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -10747,6 +10838,13 @@ vite-plugin-monaco-editor@^1.0.10: resolved "https://registry.npmmirror.com/vite-plugin-monaco-editor/-/vite-plugin-monaco-editor-1.1.0.tgz#a6238c2e13d5e98dd54a1bc51f6f189325219de3" integrity sha512-IvtUqZotrRoVqwT0PBBDIZPNraya3BxN/bfcNfnxZ5rkJiGcNtO5eAOWWSgT7zullIAEqQwxMU83yL9J5k7gww== +vite-plugin-qiankun@^1.0.15: + version "1.0.15" + resolved "https://registry.npmmirror.com/vite-plugin-qiankun/-/vite-plugin-qiankun-1.0.15.tgz#862bb6935c50db31536cf322e13f3bf59e1adace" + integrity sha512-0QB0Wr8Eu/LGcuJAfuNXDb7BAFDszo3GCxq4bzgXdSFAlK425u1/UGMxaDEBVA1uPFrLsZPzig83Ufdfl6J45A== + dependencies: + cheerio "^1.0.0-rc.10" + vite-plugin-windicss@^1.8.3: version "1.8.8" resolved "https://registry.npmmirror.com/vite-plugin-windicss/-/vite-plugin-windicss-1.8.8.tgz#ff1adf7d1a1c38634c77a4c0125fa730d16138e7"