-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.config.ts
49 lines (42 loc) · 1.14 KB
/
app.config.ts
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
/* eslint-disable @typescript-eslint/ban-ts-comment */
//@ts-ignore
import doraMergeConfig from '@hellobikefe/dora/src/export/doraMergeConfig';
/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
//@ts-ignore
import aliMPConfig from './aliMPConfig.config';
//@ts-ignore
import H5Config from './h5Config.config';
//@ts-ignore
import wechatConfig from './wechatMPConfig.config';
//@ts-ignore
import baiduConfig from './baiduMPConfig.config';
/* eslint-disable import/no-commonjs */
const configConst = require('./config.const.ts');
const { appNameConfig : {
wechatAppName = '',
alipayAppName = '',
h5AppName = '',
baiduAppName = '',
} = {} } = configConst;
console.log(process.env.APPNAME);
let config;
switch (process.env.APPNAME) {
case alipayAppName:
config = aliMPConfig;
break;
case baiduAppName:
config = baiduConfig;
break;
case wechatAppName:
config = wechatConfig;
break;
case h5AppName:
config = H5Config;
break;
default:
throw new Error(`app ${process.env.APPNAME}不存在`);
}
console.log(doraMergeConfig);
const appConfig = doraMergeConfig(config);
console.log(appConfig);
export default appConfig;