-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
69 lines (69 loc) · 1.75 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* @Descripttion:
* @version:
* @Author: Caoshuangna
* @Date: 2019-10-11 11:18:40
* @LastEditors: Caoshuangna
* @LastEditTime: 2021-06-11 14:07:34
*/
// 作为配置文件,直接导出配置对象即可
module.exports = {
lintOnSave: false,
productionSourceMap: false,
// publicPath: '/weike/',//注意nginx对应配置
devServer: {
disableHostCheck: true,
clientLogLevel: 'warning',
// 代理器中设置/api,项目中请求路径为/api的替换为target
proxy: {
'/api/': {
target: 'http://192.168.30.50:8082/hcss',
changeOrigin: true,// 如果接口跨域,需要进行这个参数配置
//pathRewrite方法重写url
pathRewrite: {
'^/api/': ''
}
}
}
},
// configureWebpack: config => {
// if (process.env.NODE_ENV === 'production') {
// // 为生产环境修改配置...
// } else {
// // 为开发环境修改配置...
// }
// },
css: {
loaderOptions: {
less: {
modifyVars: {
'border-radius-base': '8px',
'border-radius-sm': '8px',
// 'font-size-base': '1rem',
},
javascriptEnabled: true
},
postcss: {
plugins: [
require("postcss-px-to-viewport")({
unitToConvert: "px",
viewportWidth: 1920,
viewportHeight: 1080,
unitPrecision: 3,
propList: [
"*"
],
viewportUnit: "vw",
fontViewportUnit: "vw",
selectorBlackList: [],
minPixelValue: 1,
mediaQuery: false,
replace: true,
exclude: /(\/|\\)(node_modules)(\/|\\)/,
// include: /\/src\//
})
]
}
}
}
}