代码拉取完成,页面将自动刷新
const path = require('path');
const webpack = require('webpack');
const CompressionWebpackPlugin = require('compression-webpack-plugin');
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const {
BASE_URL, NODE_ENV, VUE_APP_MODE, VUE_APP_NAME,
} = process.env;
const webpackPlugins = [
new webpack.ProvidePlugin({
'window.Quill': 'quill',
}),
new LodashModuleReplacementPlugin(),
new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /zh-cn$/),
];
if (NODE_ENV !== 'development') {
webpackPlugins.push(new CompressionWebpackPlugin({
filename: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(js|css)$',
),
threshold: 81920,
minRatio: 0.8,
}));
// 打包 包体积分析
webpackPlugins.push(new BundleAnalyzerPlugin()); // 自动化部署注销此代码
}
module.exports = {
publicPath: '/admin',
lintOnSave: 'error',
productionSourceMap: false,
devServer: {
disableHostCheck: true,
proxy: {
'/kprSystemApi': {
target: 'http://172.16.0.108:8888',
ws: true,
changeOrigin: true,
},
},
},
css: {
loaderOptions: {
less: {
lessOptions: {
globalVars: {
'aside-width': '208px',
'aside-mini-width': '80px',
'header-height': '48px',
'footer-height': '48px',
},
javascriptEnabled: true,
},
},
},
},
configureWebpack: {
plugins: webpackPlugins,
module: {},
externals: {
TMap: 'TMap',
qq: 'qq',
},
},
chainWebpack(config) {
config.resolve.alias.set('@', path.resolve(__dirname, 'src'));
config.plugin('html').tap((args) => {
const f = args[0];
f.title = VUE_APP_NAME;
return args;
});
},
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [],
},
},
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。