-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.dev.js
97 lines (94 loc) · 2.48 KB
/
webpack.dev.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require('path');
const zenkoDNS = 'zenko.local';
const accessControlAllowHeaders = [
'X-Requested-With',
'content-type',
'Authorization',
'x-amz-content-sha256',
'x-amz-user-agent',
'x-amz-security-token',
'x-amz-date',
'if-none-match',
'x-amz-bucket-object-lock-enabled',
'x-authentication-token',
'content-md5',
'x-amz-bypass-governance-retention',
];
module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
output: {
publicPath: '/zenko/',
},
devServer: {
static: path.join(__dirname, 'public/assets'),
host: '127.0.0.1',
port: 8383,
historyApiFallback: true,
hot: false,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods':
'GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD',
'Access-Control-Allow-Headers': accessControlAllowHeaders.join(', '),
'Access-Control-Expose-Headers': 'ETag',
},
proxy: {
'/s3': {
target: `https://s3.${zenkoDNS}`,
pathRewrite: { '^/s3': '' },
secure: false,
changeOrigin: true,
logLevel: 'debug',
logProvider: () => console,
onProxyRes: function (proxyRes, req, res) {
if (req.method === 'OPTIONS') {
proxyRes.statusCode = 200;
}
},
},
'/iam': {
target: `https://iam.${zenkoDNS}`,
pathRewrite: { '^/iam': '' },
secure: false,
changeOrigin: true,
logLevel: 'debug',
logProvider: () => console,
onProxyRes: function (proxyRes, req, res) {
if (req.method === 'OPTIONS') {
proxyRes.statusCode = 200;
}
},
},
'/sts': {
target: `https://sts.${zenkoDNS}`,
pathRewrite: { '^/sts': '' },
secure: false,
changeOrigin: true,
logLevel: 'debug',
logProvider: () => console,
onProxyRes: function (proxyRes, req, res) {
if (req.method === 'OPTIONS') {
proxyRes.statusCode = 200;
}
},
},
'/management': {
target: `https://management.${zenkoDNS}`,
pathRewrite: { '^/management': '' },
secure: false,
changeOrigin: true,
logLevel: 'debug',
logProvider: () => console,
},
},
client: {
overlay: {
warnings: false,
errors: true,
},
},
},
});