1 Star 0 Fork 226

何苦/leadshop后台VUE源码

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
vue.config.js 2.06 KB
Copy Edit Raw Blame History
wj005 authored 2021-09-27 16:26 . v1.4.3
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const CompressionPlugin = require('compression-webpack-plugin');
const path = require('path');
const { ContextReplacementPlugin } = require('webpack');
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
lintOnSave: false,
outputDir: 'dist',
devServer: {
open: true,
overlay: {
warnings: true,
errors: true
}
},
filenameHashing: true,
productionSourceMap: false,
publicPath: process.env.NODE_ENV === 'production' ? '/assets/admin' : '/',
configureWebpack: config => {
const plugins = [new ContextReplacementPlugin(/moment[/\\]locale$/, /zh-cn/)];
if (process.env.BUNDLE_ANALYZER === 'YES') {
plugins.push(new BundleAnalyzerPlugin());
}
config.plugins = [...config.plugins, ...plugins];
},
chainWebpack: config => {
config.when(process.env.NODE_ENV !== 'development', config => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [
{
inline: /runtime\..*\.js$/
}
])
.end();
config.optimization.runtimeChunk('single');
});
config.plugins.delete('prefetch');
config.plugins.delete('preload');
config.optimization.splitChunks({
chunks: 'all',
maxInitialRequests: 4,
minSize: 0,
cacheGroups: {
leadshop: {
name: 'chunk-leadshop',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial'
},
elementUi: {
name: 'chunk-elementUi',
test: /[\\/]node_modules[\\/]_?element-ui(.*)/,
priority: 20
},
echarts: {
name: 'chunk-echarts',
test: /[\\/]node_modules[\\/]_?echarts(.*)/,
priority: 20
},
common: {
name: 'chunk-commom',
test: resolve('src/components'),
minChunks: 2,
priority: 5,
reuseExistingChunk: true
}
}
});
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/y-china-y/panel.git
git@gitee.com:y-china-y/panel.git
y-china-y
panel
leadshop后台VUE源码
master

Search