forked from oscarhealth/covid19-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
51 lines (50 loc) · 1.33 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* eslint-disable local/prefer-export */
module.exports = {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'entry',
corejs: 2,
},
],
'@babel/preset-flow',
'@babel/preset-react',
],
plugins: [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-async-generator-functions',
'@babel/plugin-transform-async-to-generator',
'@babel/plugin-transform-modules-commonjs',
'@babel/plugin-transform-runtime',
'add-module-exports',
[
'babel-plugin-transform-builtin-extend',
{
globals: ['Error'],
},
],
[
'react-intl',
{
messagesDir: '.tx/extract/javascript',
},
],
'react-hot-loader/babel',
],
ignore: ['javascript/flow/**/*.js'],
env: {
/** We run our jest tests with NODE_ENV=testing. Plugins added here
* will be used by jest when running tests but will not apply to
* code being bundled for our normal target environments. This is generally
* useful for features that need different handling in nodejs vs the browser,
* such as dynamic import.
*/
testing: {
plugins: ['dynamic-import-node'],
},
},
};