forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.babelrc.js
45 lines (42 loc) · 852 Bytes
/
.babelrc.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
module.exports = (api) => {
const env = api.env();
let dev = false;
let setUseClient = false;
let modules;
switch (env) {
case 'docs':
case 'test':
case 'dist-dev':
dev = true;
modules = false;
break;
case 'dist-prod':
modules = false;
break;
case 'esm':
modules = false;
setUseClient = true;
break;
case 'cjs':
default:
modules = 'commonjs';
setUseClient = true;
break;
}
return {
presets: [
[
'@react-bootstrap',
{
dev,
modules,
removePropTypes: !dev,
setUseClient,
customClientImports: ['useBootstrapPrefix', 'createWithBsPrefix'],
},
],
'@babel/preset-typescript',
],
plugins: [env === 'test' && 'istanbul'].filter(Boolean),
};
};