diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 9ca629c7..00000000 --- a/babel.config.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = api => ({ - production: { - presets: [ - ['@babel/preset-env', { - useBuiltIns: false, - loose: true, - }], - '@babel/preset-typescript', - ], - plugins: [ - '@babel/plugin-syntax-dynamic-import', - ['@babel/plugin-transform-runtime', { - helpers: true, - regenerator: true, - }], - '@babel/plugin-proposal-optional-catch-binding', - ], - }, - development: { - presets: [ - ['@babel/preset-env', { - targets: { esmodules: true }, - }], - '@babel/preset-typescript', - ], - plugins: [ - '@babel/plugin-syntax-dynamic-import', - '@babel/plugin-proposal-optional-catch-binding', - ], - }, - test: { - presets: [ - ['@babel/preset-env', { - targets: { node: 'current' }, - }], - '@babel/preset-typescript', - ], - plugins: [ - 'babel-plugin-dynamic-import-node', - '@babel/plugin-proposal-optional-catch-binding', - ], - }, -})[api.env()] diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 00000000..08d7b188 --- /dev/null +++ b/babel.config.json @@ -0,0 +1,55 @@ +{ + "presets": [ + "@babel/preset-typescript" + ], + "plugins": [], + "env": { + "production": { + "presets": [ + [ + "@babel/preset-env", + { + "useBuiltIns": false, + "loose": true + } + ] + ], + "plugins": [ + [ + "@babel/plugin-transform-runtime", + { + "helpers": true, + "regenerator": true + } + ] + ] + }, + "development": { + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "esmodules": true + } + } + ] + ] + }, + "test": { + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "node": "current" + } + } + ] + ], + "plugins": [ + "babel-plugin-dynamic-import-node" + ] + } + } +}