-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.babelrc.js
65 lines (60 loc) · 2.28 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
53
54
55
56
57
58
59
60
61
62
63
64
65
module.exports = (api) => {
api.cache(false);
return {
/*
'env': {
'test': {
'plugins': [
require.resolve('babel-plugin-dynamic-import-node'),
],
},
},
*/
'presets': [
require.resolve(
'@babel/preset-env',
{
'loose': true,
'useBuiltIns': false,
// 'useBuiltIns': 'usage',
// 'corejs': 3,
// 'debug': true,
}
),
require.resolve('@babel/preset-react'),
require.resolve('@babel/preset-typescript'),
],
'plugins': [
// Reuse babel's injected headers
require.resolve('@babel/plugin-transform-runtime'),
[require('babel-plugin-polyfill-corejs3'), {
"method": "usage-pure",
// "targets": { "firefox": 42 }
}],
require.resolve('@babel/plugin-proposal-do-expressions'),
require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'),
require.resolve('@babel/plugin-proposal-optional-chaining'),
// Stage 2
[require.resolve('@babel/plugin-proposal-decorators'), { 'legacy': true }],
require.resolve('@babel/plugin-proposal-function-sent'),
require.resolve('@babel/plugin-proposal-export-namespace-from'),
require.resolve('@babel/plugin-proposal-numeric-separator'),
require.resolve('@babel/plugin-proposal-throw-expressions'),
// Stage 3
require.resolve('@babel/plugin-syntax-dynamic-import'),
require.resolve('@babel/plugin-syntax-import-meta'),
[require.resolve('@babel/plugin-proposal-class-properties'), { 'loose': false }],
require.resolve('@babel/plugin-proposal-json-strings'),
[
require.resolve('babel-plugin-module-resolver'),
{
'root': ['.'],
'extensions': ['.js', '.jsx', '.ts', '.tsx'],
'alias': {
'#components': './src/components',
},
},
],
],
};
};