-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvue.config.js
More file actions
45 lines (42 loc) · 1.37 KB
/
vue.config.js
File metadata and controls
45 lines (42 loc) · 1.37 KB
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
const path = require("path");
const webpack = require("webpack");
const WebpackBar = require('webpackbar');
const resolve = (dir) => {
return path.join(__dirname, dir);
};
module.exports = {
publicPath: "./", // ./相对路径
outputDir: "dist",
productionSourceMap: false,// 打包时不生成.map文件
// 这里写你调用接口的基础路径,来解决跨域
devServer: {
port: 9084,
open: true,
proxy: {
'/dev-api': {
target: 'https://www.fastmock.site/mock/00e1901228c9f92cbd69705ba612eece/pro-api',
pathRewrite: { '^/dev-api': '' }
},
'/pro-api': {
target: 'https://www.fastmock.site/mock/00e1901228c9f92cbd69705ba612eece/pro-api',
pathRewrite: { '^/pro-api': '' }
}
}
},
configureWebpack() {
return {
plugins: [
new WebpackBar({
color: "green", // 默认green,进度条颜色支持HEX
basic: false, // 默认true,启用一个简单的日志报告器
profile: false, // 默认false,启用探查器。
})
]
}
},
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src'))
.set('views', resolve('src/views'))
},
}