-
Notifications
You must be signed in to change notification settings - Fork 5
/
vue.config.js
43 lines (42 loc) · 1.11 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* @description:
* @author: 小羽
* @github: https://github.com/sulgweb
* @lastEditors: 小羽
* @Date: 2019-10-09 21:55:04
* @LastEditTime: 2020-09-12 10:53:30
* @Copyright: 1.0.0
*/
const path = require("path")
function addStyleResource(rule) {
rule.use('style-resource')
.loader('style-resources-loader')
.options({
patterns: [path.resolve(__dirname, "./src/assets/style/common.less")]
})
}
module.exports = {
//eslint开关
lintOnSave: false,
//生成环境是否生成map文件
productionSourceMap: false,
devServer: {
host: '0.0.0.0',
//代理配置
proxy: {
'/webserve': {
target: 'http://127.0.0.1:8512',
ws: true,
changeOrigin: true,
pathRewrite: {
'^/webserve': ''
}
},
},
},
chainWebpack: (config) => {
//配置less
const types = ['vue-modules', 'vue', 'normal-modules', 'normal']
types.forEach(type => addStyleResource(config.module.rule('less').oneOf(type)))
},
}