-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
48 lines (48 loc) · 1.94 KB
/
webpack.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
const webpack = require("webpack");
const config = {
entry: __dirname + "/src/index.js", //配置入口文件
output: {
path: __dirname + "/web", //打包文件的输出文件夹
filename: "build.js" //打包文件的名字
},
devServer: {
port: 8011,
host: "192.168.10.233",
// host: "192.168.155.233",//尹总公司的机器
// host: "127.0.0.1",
useLocalIp: true,//允许使用本地ip打开
open: false, //是否打开浏览器,
contentBase: "./web",
publicPath: "./web",//这个目录下的文件在浏览器中可以直接访问
/* index: "index", //可以修改索引文件名
openPage: 'index.html',//浏览打开的时候,默认访问的链接地址 */
index: "portal", //可以修改索引文件名
openPage: 'portal.html',//浏览打开的时候,默认访问的链接地址
historyApiFallback: true, //不跳转
inline: true, //实时刷新,
proxy: {
//配置需要转发的接口
/* "/sso/**": {
target: "http://www.xyzqts.cn:8072", //需要转发到哪里
changeOrigin: true,
secure: false //是否加密
}, */
"/cgi-bin/luci/api/v1/**": {
target: "https://192.168.10.127", //格律的这个路径转发需要加https,否则跨域
// target: "https://192.168.155.198", //尹总公司的机器
changeOrigin: true,
secure: false //是否加密
},
/* "/wechat/mp/xyit/**": {
target: "http://27.151.112.180:8079", //需要转发到哪里
changeOrigin: true,
secure: false //是否加密
}, */
},
overlay: {//如果有错误的信息,直接全屏覆盖提示
warnings: true,
errors: true
}
}
}
module.exports = config;