-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.js
55 lines (51 loc) · 1.26 KB
/
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
50
51
52
53
54
55
/* eslint-disable @typescript-eslint/no-var-requires */
const { application: devBucket } = require('./.ciri-upload.config.js');
const { application: debugBucket } = require('./.ciri-upload.debug.config.js');
const { application: prodBucket } = require('./.ciri-upload.prod.config.js');
const production = {
api: 'production/api',
cdnBucket: prodBucket,
get cdnBucketPath() {
return `https://biv.oss-cn-hangzhou.aliyuncs.com/${this.cdnBucket}/dist/`;
}
};
const dev = {
api: 'http://192.168.1.234:10999',
cdnBucket: devBucket,
get cdnBucketPath() {
return `https://biv.oss-cn-hangzhou.aliyuncs.com/${this.cdnBucket}/dist/`;
}
};
const debug = {
api: 'http://39.98.120.120:10999',
cdnBucket: debugBucket, // 公用测试bucket
get cdnBucketPath() {
return `https://biv.oss-cn-hangzhou.aliyuncs.com/${this.cdnBucket}/dist/`;
}
};
module.exports = ((env) => {
let config;
switch (env) {
case 'development': {
config = dev;
break;
}
case 'test': {
config = production;
break;
}
case 'production': {
config = production;
break;
}
case 'debug': {
config = debug;
break;
}
default: {
config = dev;
break;
}
}
return config;
})(process.env.NODE_ENV);