捕梦者基础前端框架
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
778 B

const CompressionWebpackPlugin = require('compression-webpack-plugin');
const { transformElementScss } = require('ele-admin/lib/utils/dynamic-theme');
module.exports = {
productionSourceMap: false,
transpileDependencies: ['element-ui', 'ele-admin', 'vue-i18n'],
chainWebpack(config) {
config.plugins.delete('prefetch');
if (process.env.NODE_ENV !== 'development') {
// 对超过10kb的文件gzip压缩
config.plugin('compressionPlugin').use(
new CompressionWebpackPlugin({
test: /\.(js|css|html)$/,
threshold: 10240
})
);
}
},
css: {
loaderOptions: {
sass: {
sassOptions: {
outputStyle: 'expanded',
importer: transformElementScss()
}
}
}
}
};