完成 微前端拆分
This commit is contained in:
@@ -1 +1,10 @@
|
||||
# 临时占位,上传空文件夹,保存文件结构用,后面删除
|
||||
npm install
|
||||
npm run build
|
||||
npm run serve
|
||||
|
||||
|
||||
构建与部署:
|
||||
|
||||
- 在构建生产环境时,先构建主模块,并将其产出(特别是 remoteEntry.js 和对应的资产文件)部署到服务器,并获取其 URL。
|
||||
- 然后,在子模块的 vite.config.ts 中,将 remotes 的 URL 更新为生产环境主模块 remoteEntry.js 的绝对 URL。
|
||||
- 最后再构建子模块。
|
||||
3
front-end/app-product/src/shared/types/product-federation.d.ts
vendored
Normal file
3
front-end/app-product/src/shared/types/product-federation.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare module 'mainApp/productService' {
|
||||
export const product: any;
|
||||
}
|
||||
Reference in New Issue
Block a user