-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
61 lines (57 loc) · 1.31 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(dir) {
return path.join(__dirname, dir);
}
module.exports = {
publicPath: process.env.NODE_ENV === "development" ? "/" : "/",
chainWebpack: config => {
config.module
.rule("images")
.use("url-loader")
.loader("url-loader")
.tap(options => Object.assign(options, { limit: 2048 }));
config.resolve.alias.set("@", resolve("src"));
},
// configureWebpack: {
// externals: {
// vue: "Vue",
// vuex: "Vuex",
// "vue-router": "VueRouter",
// "element-ui": "ELEMENT"
// },
// plugins: []
// }
devServer: {
// port: 8080
// proxy: {
// "/api": {
// target:
//
// target: "http://192.168.1.106:8080/",
// ws: true,
// changeOrigin: true, //是否跨域
// pathRewrite: {
// "/api": "/api"
// }
// }
// },
// host: "localhost",
// port: "8080",
// hot: true,
// open: true,
// overlay: {
// warning: false,
// error: true
// },
proxy: {
[process.env.VUE_APP_BASE_API]: {
target: process.env.VUE_APP_BASE_API,
changeOrigin: true, //是否跨域
secure: false,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: ""
}
}
}
}
};