-
Notifications
You must be signed in to change notification settings - Fork 1
/
babel.config.cjs
50 lines (48 loc) · 1.25 KB
/
babel.config.cjs
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
const path = require('path');
const config = {
presets: [
[
'@babel/typescript',
{
onlyRemoveTypeImports: true,
allowDeclareFields: true,
},
],
[
'@babel/react',
{
useSpread: true,
useBuiltIns: true,
runtime: 'automatic',
},
],
[
'@babel/env',
{
useBuiltIns: 'usage',
loose: true,
modules: process.env.BABEL_ENV === 'es' ? false : 'commonjs',
bugfixes: true,
corejs: '3.x',
browserslistEnv: 'production',
},
],
],
plugins: [
[
require.resolve('babel-plugin-custom-import-path-transform'),
{
transformImportPath: path.resolve(__dirname, 'scripts/transformImportPath.js'),
},
],
[
require.resolve('babel-plugin-module-resolver'),
{
root: ['./src'],
},
],
[require.resolve('babel-plugin-transform-imports')],
],
ignore: ['**/__tests__/', '**/*.test.ts'],
};
module.exports = config;