代码拉取完成,页面将自动刷新
同步操作将从 LEADSHOP开源商城系统/leadshop后台VUE源码 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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
}
}
});
}
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。