|
@@ -10,7 +10,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
|
|
|
const name = process.env.VUE_APP_TITLE || '后台管理系统' // 网页标题
|
|
|
|
|
|
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
|
|
-
|
|
|
+const isDev = process.env.NODE_ENV !== "production";
|
|
|
// vue.config.js 配置说明
|
|
|
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
|
|
|
// 这里只列一部分,具体配置参考文档
|
|
@@ -35,7 +35,7 @@ module.exports = {
|
|
|
proxy: {
|
|
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
|
|
[process.env.VUE_APP_BASE_API]: {
|
|
|
- target: `http://localhost:8080`,
|
|
|
+ target: `http://192.168.110.59:8080`,
|
|
|
changeOrigin: true,
|
|
|
pathRewrite: {
|
|
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
|
@@ -48,6 +48,15 @@ module.exports = {
|
|
|
loaderOptions: {
|
|
|
sass: {
|
|
|
sassOptions: { outputStyle: "expanded" }
|
|
|
+ },
|
|
|
+ less: {
|
|
|
+ modifyVars: {
|
|
|
+ "primary-color": "#13c2c2",
|
|
|
+ // "primary-color": "#9867f7",
|
|
|
+ "layout-color": "#9867f7"
|
|
|
+ // "layout-color": "#ee88aa"
|
|
|
+ },
|
|
|
+ javascriptEnabled: true
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -65,9 +74,11 @@ module.exports = {
|
|
|
test: /\.(js|css|html)?$/i, // 压缩文件格式
|
|
|
filename: '[path].gz[query]', // 压缩后的文件名
|
|
|
algorithm: 'gzip', // 使用gzip压缩
|
|
|
- minRatio: 0.8 // 压缩率小于1才会压缩
|
|
|
+ minRatio: 0.8, // 压缩率小于1才会压缩
|
|
|
+
|
|
|
})
|
|
|
],
|
|
|
+ devtool: isDev ? "source-map" : false
|
|
|
},
|
|
|
chainWebpack(config) {
|
|
|
config.plugins.delete('preload') // TODO: need test
|
|
@@ -130,6 +141,7 @@ module.exports = {
|
|
|
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
|
|
|
to: './' //到根目录下
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
)
|
|
|
}
|