m2pool_web_frontend/mining-pool/vue.config.js

63 lines
1.5 KiB
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.

const { defineConfig } = require('@vue/cli-service');
module.exports = defineConfig({
transpileDependencies: true,
// 生产环境不生成source map
productionSourceMap: false,
// 开发环境:关闭浏览器全屏遮罩错误提示,仅在控制台输出
// 说明webpack-dev-server v4 推荐使用 client.overlay=false
// 如果未来降级到 v3可改为 overlay:false
devServer: {
client: {
overlay: false
}
// overlay: false
},
configureWebpack: {
optimization: {
splitChunks: {
chunks: 'all',
minSize: 100000, // 增加最小分块大小到100KB
maxSize: 500000, // 增加最大分块大小到500KB
cacheGroups: {
vendors: {
name: 'chunk-vendors',
test: /[\\/]node_modules[\\/]/,
priority: -10,
chunks: 'initial'
},
common: {
name: 'chunk-common',
minChunks: 2,
priority: -20,
chunks: 'initial',
reuseExistingChunk: true
}
}
}
}
},
chainWebpack: config => {
// 移除 prefetch 插件,减少不必要的预加载
config.plugins.delete('prefetch');
// 简化HTML压缩
config.plugin('html').tap(args => {
args[0].minify = {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
};
return args;
});
},
css: {
extract: true,
sourceMap: false
}
});