Skip to content

Commit f55514a

Browse files
authored
fix(mpa): conflicts with webpack plugin (#10005)
1 parent c70a8c9 commit f55514a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

examples/mpa/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@example/mpa",
33
"private": true,
44
"scripts": {
5+
"build": "umi build",
56
"dev": "umi dev",
67
"start": "npm run dev"
78
},

packages/preset-umi/src/features/webpack/webpack.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ export default (api: IApi) => {
6969
}
7070

7171
api.modifyWebpackConfig((config) => {
72-
// 处理 代码拆分时, 拆分的 非 入口文件, 自动注入到 html 文件中
73-
config.plugins?.push(new HtmlWebpackPlugin());
72+
if (!api.config.mpa) {
73+
// 处理 代码拆分时, 拆分的 非 入口文件, 自动注入到 html 文件中
74+
config.plugins?.push(new HtmlWebpackPlugin());
75+
}
7476
return config;
7577
});
7678

0 commit comments

Comments
 (0)