1 Star 0 Fork 0

HuYong/ant-admin-v2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
HuYong 提交于 2022-10-20 17:44 . 首次提交
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: [],
},
},
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shuaigeyong/ant-admin-v2.git
git@gitee.com:shuaigeyong/ant-admin-v2.git
shuaigeyong
ant-admin-v2
ant-admin-v2
dev

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385