forked from oVirt/ovirt-engine-ui-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.babelrc.js
52 lines (47 loc) · 1.14 KB
/
.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
46
47
48
49
50
51
52
const chalk = require('chalk')
const env = process.env.NODE_ENV || 'development'
const DEV = env === 'development'
// babel configs
module.exports = api => ({
presets: [
[
'@babel/preset-env',
{
debug: !process.env.Q && DEV,
targets: {
node: 'current',
},
useBuiltIns: 'usage',
corejs: '3.13',
exclude: ['transform-typeof-symbol'],
},
],
[
'@babel/preset-react',
{
runtime: 'classic',
useBuiltIns: true,
},
],
],
plugins: [
DEV && './babel-plugin/fancy-console',
api.env('test') && [
'./babel-plugin/fancy-console',
{
loggers: [
{
object: 'console',
methods: ['log', 'info', 'warn', 'error'],
enhancements: {
log: [chalk.bold.white.bgHex('#21409a')(' debug ')],
info: [chalk.bold.white.bgHex('#01acac')(' info ')],
warn: [chalk.bold.white.bgHex('#f8a51b')(' warn ')],
error: [chalk.bold.white.bgHex('#ed403c')(' error ')],
},
},
],
},
],
].filter(Boolean),
})