-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
49 lines (47 loc) · 1.24 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
/*
* @Author: wjw
* @Date: 2020-12-09 09:11:14
* @LastEditTime: 2021-01-20 10:10:00
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \react-punkd:\work\vue-book\vue.config.js
*/
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir);
}
const vueConfig = {
publicPath: process.env.NODE_ENV === "development" ? "/" : "./",
productionSourceMap: process.env.NODE_ENV === "development" ? true : false,
// 配置路径别名
chainWebpack: (config) => {
config.resolve.alias
.set("@", resolve("src"))
.set("components", resolve("src/components"))
.set("store", resolve("src/store"))
.set("views", resolve("src/views"))
.set("assets", resolve("src/assets"));
},
devServer: {
// host: "localhost",
port: 8080, // 端口号
https: false, // https:{type:Boolean}
open: true, //配置自动启动浏览器
overlay: {
warnings: false,
errors: false,
},
proxy: {
"/api": {
target: process.env.VUE_APP_SERVER_URL,
changeOrigin: true,
pathRewrite: {
"^/api": "",
},
},
},
disableHostCheck: true,
},
lintOnSave: false,
};
module.exports = vueConfig;