-
Notifications
You must be signed in to change notification settings - Fork 12
/
babel.config.js
33 lines (32 loc) · 1.09 KB
/
babel.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
'use strict';
module.exports = {
presets: [
[
'@babel/preset-env',
{
modules: process.env.NODE_ENV === 'test' ? 'auto' : false,
// Exclude transforms that make all code slower.
exclude: ['transform-typeof-symbol'],
targets: process.env.NODE_ENV === 'test' ? {node: 'current'} : {ie: 11},
},
],
'@babel/preset-react',
],
plugins: [
['@babel/plugin-proposal-class-properties', {loose: true}],
['@babel/plugin-transform-classes', {loose: true}],
['@babel/plugin-transform-template-literals', {loose: true}],
// The following plugin is configured to use `Object.assign` directly.
// Note that we ponyfill `Object.assign` below.
// { ...todo, complete: true }
[
'@babel/plugin-proposal-object-rest-spread',
{loose: true, useBuiltIns: true},
],
// Use 'object-assign' ponyfill.
require.resolve('./scripts/babel/transform-object-assign-require'),
// Keep stacks detailed in tests.
process.env.NODE_ENV === 'test' &&
'@babel/plugin-transform-react-jsx-source',
].filter(Boolean),
};