-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvue.config.js
47 lines (47 loc) · 1.03 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
module.exports = {
publicPath: "/",
productionSourceMap: false,
css: {
loaderOptions: {
// 给 sass-loader 传递选项
sass: {
data: `
@import "@/assets/stylesheet/base.scss";
`
}
}
},
devServer: {
open: true, //浏览器自动打开页面
host: "0.0.0.0", //如果是真机测试,就使用这个IP
port: 8081,
proxy: {
//配置跨域
"^/api": {
target: "http://10.3.4.18",
ws: true,
changOrigin: true
},
"^/api/alien": {
target: "http://10.3.4.18",
ws: true,
changOrigin: true
}
}
// https: true,
},
configureWebpack: {
devtool: "source-map"
},
chainWebpack: config => {
if (process.env.NODE_ENV === "production") {
if (process.env.npm_config_report) {
config
.plugin("webpack-bundle-analyzer")
.use(require("webpack-bundle-analyzer").BundleAnalyzerPlugin)
.end();
config.plugins.delete("prefetch");
}
}
}
};