wsyt/vue.config.js
2024-02-26 11:01:08 +08:00

11 lines
338 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module.exports = {
chainWebpack: config => {
// 设置阈值10KB超过此大小的图片文件会被处理
config.module.rule('images')
.test(/\.(png|jpe?g|gif|webp)(\?.*)?$/)
.use('url-loader')
.loader('url-loader')
.tap(options => Object.assign(options, { limit: 10240 }))
.end();
}
};