-
Notifications
You must be signed in to change notification settings - Fork 0
/
.babelrc.js
67 lines (63 loc) · 2.45 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
66
67
module.exports = (api) => {
return {
'env': {
'test': {
'plugins': [
require.resolve('babel-plugin-dynamic-import-node'),
],
},
},
'presets': [
require.resolve('@babel/preset-typescript'),
require.resolve('@babel/preset-react'),
require.resolve(
'@babel/preset-env',
api.env('development')
? {
'useBuiltIns': "usage",
'corejs': 3,
'debug': true,
}
: undefined,
),
],
'plugins': [
// Reuse babel's injected headers
[require.resolve('@babel/plugin-transform-runtime'), {
'corejs': 3,
'regenerator': true,
}],
// 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',
'#config': './src/config',
'#request': './src/request',
'#resources': './src/resources',
'#schema': './src/schema',
'#ts': './src/ts',
'#utils': './src/utils',
'#views': './src/views',
'#types': './src/typings',
'#hooks': './src/hooks',
'#remap': './src/vendor/re-map',
},
},
],
],
};
};