-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
61 lines (57 loc) · 1.53 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
// const path = require('path')
// function resolve(pathname) {
// return path.resolve(__dirname, pathname)
// }
module.exports = {
publicPath: process.env.NODE_ENV === 'production'
? 'http://10.60.18.160/xishiqu'
: '/',
// 基本路径
// baseUrl: './',
// // 输出文件目录
// outputDir: 'dist',
// // eslint-loader 是否在保存的时候检查
// lintOnSave: true,
// // use the full build with in-browser compiler?
// // https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only
// runtimeCompiler: true, //关键点在这
// webpack配置
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
chainWebpack: () => {},
configureWebpack: config => {
// console.log(config)
// config.resolve.alias = {
// ...config.resolve.alias,
// home: resolve('./src/views/home'),
// assets: resolve('./src/assets'),
// utils: resolve('./src/utils')
// }
},
devServer: {
// host: '10.60.18.51',
// port: 8080,
proxy: {
'/ajax': {
target: 'http://m.xishiqu.com',
secure: false,//false 为http
changeOrigin: true
// pathRewrite: {
// "^/proxy": ""
// }
},
'/api': {
target: 'http://m.xishiqu.com',
secure: false,//false 为http
changeOrigin: true
},
'/proxy': {
target: 'http://www.chinanews.com',
secure: false,//false 为http
changeOrigin: true,
pathRewrite: {
"^/proxy": ""
}
}
}
}
}