Skip to content

Commit 316e162

Browse files
committed
fix: 修复一些问题
1 parent 23b18f6 commit 316e162

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/extends/unified/app.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,17 @@ module.exports = function unifiedExtend(api, opts) {
9090
});
9191
}
9292

93-
webpackChain
94-
.plugin(pname)
95-
.use(HTMLPlugin, [ htmlOpts ]);
93+
if (!webpackChain.plugins.has(pname)) {
94+
webpackChain
95+
.plugin(pname)
96+
.use(HTMLPlugin, [ htmlOpts ]);
97+
} else {
98+
webpackChain
99+
.plugin(pname)
100+
.tap(args => {
101+
return [ Object.assign({}, args[0] || {}, htmlOpts) ];
102+
});
103+
}
96104
});
97105
} else {
98106
api.logger.warn('[webpack]', 'Not Found "html-webpack-plugin"');

src/extends/unified/rules.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module.exports = function unifiedExtend(api, opts) {
3232
loader: require.resolve('file-loader'),
3333
options: {
3434
name: genAssetSubPath(dir),
35+
esModule: false,
3536
},
3637
},
3738
};
@@ -42,7 +43,7 @@ module.exports = function unifiedExtend(api, opts) {
4243
.test(/\.(png|jpe?g|gif|webp)(\?.*)?$/)
4344
.use('url-loader')
4445
.loader(require.resolve('url-loader'))
45-
.options(genUrlLoaderOptions('images'));
46+
.options(genUrlLoaderOptions('img'));
4647

4748

4849
// do not base64-inline SVGs.

0 commit comments

Comments
 (0)