forked from JoeshuTT/v-shop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
55 lines (52 loc) · 1.5 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
const autoprefixer = require('autoprefixer')
const pxtorem = require('postcss-pxtorem')
const path = require('path')
console.info(process.env.NODE_ENV)
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
lintOnSave: true,
productionSourceMap: false, // 去掉打包后js中,会自动生成的一些map文件
devServer: {
port: 8080, // 端口
proxy: {
'/api': {
target: 'http://wx.lohike.net',
changeOrigin: true, // target是域名的话,需要这个参数,
secure: false, // 设置支持https协议的代理
pathRewrite: { '^/api': '' }
},
'/shop_api': {
target: 'https://api.it120.cc/xiaochengxu',
changeOrigin: true, // target是域名的话,需要这个参数,
secure: false, // 设置支持https协议的代理
pathRewrite: { '^/shop_api': '' }
}
}
},
chainWebpack: (config) => {
config.resolve.alias
.set('@', resolve('src'))
.set('@assets', resolve('src/assets'))
.set('@styles', resolve('src/styles'))
},
css: {
loaderOptions: {
postcss: {
plugins: [
autoprefixer({
browsers: ['Android >= 4.0', 'iOS >= 7']
}),
pxtorem({
rootValue: 50,
unitPrecision: 3,
propList: ['*', '!font*'],
selectorBlackList: ['.ignore ', '.hairlines', 'van-circle__layer', '.van-hairline'],
minPixelValue: 2
})
]
}
}
}
}