-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbabel.config.js
37 lines (35 loc) · 1.05 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
// * Every now and then, we adopt best practices from CRA
// * https://tinyurl.com/yakv4ggx
// ? https://nodejs.org/en/about/releases
const NODE_OLDEST_LTS = '10.13.0';
module.exports = {
parserOpts: { strictMode: true },
plugins: ['@babel/plugin-proposal-export-default-from'],
env: {
// * Used by Jest and `npm test`
test: {
sourceMaps: 'both',
presets: [
['@babel/preset-env', { targets: { node: true } }],
['@babel/preset-typescript', { allowDeclareFields: true }]
// ? We don't care about minification
]
},
// * Used by `npm run build`
production: {
presets: [
[
'@babel/preset-env',
{
// ? https://github.com/babel/babel-loader/issues/521#issuecomment-441466991
//modules: false,
// ? https://nodejs.org/en/about/releases
targets: { node: NODE_OLDEST_LTS }
}
],
['@babel/preset-typescript', { allowDeclareFields: true }]
// ? Webpack will handle minification
]
}
}
};