forked from bbc/simorgh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.babelrc
40 lines (40 loc) · 1.23 KB
/
.babelrc
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
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": [
"chrome >= 53",
"firefox >= 45.0",
"ie >= 11",
"edge >= 37",
"safari >= 9",
"opera >= 40",
"op_mini >= 18",
"Android >= 7",
"and_chr >= 53",
"and_ff >= 49",
"ios_saf >= 10"
]
},
// analyses code & polyfills only the features that are used, only for the targeted browsers
"useBuiltIns": "usage"
}
],
"@babel/preset-react" // transform JSX to JS
],
"plugins": [
"@babel/plugin-transform-modules-commonjs", // allows module.exports at the helpers/logger.*.js
"@babel/plugin-proposal-object-rest-spread", // allows ...spread notation
"@babel/plugin-syntax-dynamic-import", // allows `await import()` syntax
"dynamic-import-node", // allows dynamic `import()` in Node tests. Webpack can do natively.
[
"babel-plugin-styled-components",
{
"ssr": true, // avoid checksum mismatches (different class generation between client & server)
"fileName": false // prevent filename forming part of class name (duplication)
}
]
]
}