-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
38 lines (37 loc) · 972 Bytes
/
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
const path = require("path");
module.exports = {
configureWebpack: () => ({
resolve: {
alias: {
"@": path.resolve("./src")
}
}
}),
chainWebpack: config => {
config.plugin("define").tap(args => {
args[0]["process.env"].BASE_URL = JSON.stringify(process.env.BASE_URL);
return args;
});
},
outputDir: "dist", //build输出目录
assetsDir: "assets", //静态资源目录(js, css, img)
lintOnSave: true, //是否开启eslint
devServer: {
open: false, //是否自动弹出浏览器页面
host: "localhost",
port: "8080",
https: false,
hotOnly: false,
proxy: {
"/api": {
target: "http://localhost:8888", //API服务器的地址
ws: true, //代理websockets
changeOrigin: true, // 虚拟的站点需要更管origin
pathRewrite: {
//重写路径 比如'/api/aaa/ccc'重写为'/aaa/ccc'
"^/api": ""
}
}
}
}
};