feat: 前端打包增加分包策略

This commit is contained in:
GraceWalk
2022-09-01 19:44:37 +08:00
parent 28e8540c78
commit 500eaace82
2 changed files with 19 additions and 23 deletions

View File

@@ -86,12 +86,12 @@ class CoverHtmlWebpackPlugin {
assetJson.reverse().forEach((item) => {
if (/\.js$/.test(item)) {
// if (item.includes('vendor~')) {
// vendors += `<script async src="${item}"></script>`;
// } else {
// TODO: entry 只有一个
portalMap['@portal/layout'] = item;
// }
if (item.includes('vendor~')) {
vendors += `<script async src="${item}"></script>`;
} else {
// TODO: entry 只有一个
portalMap['@portal/layout'] = item;
}
} else if (/\.css$/.test(item)) {
links += `<link href="${item}" rel="stylesheet">`;
}