diff --git a/.babelrc b/.babelrc deleted file mode 100644 index cb20ec2bf..000000000 --- a/.babelrc +++ /dev/null @@ -1,27 +0,0 @@ -{ - "presets": [ - "@babel/preset-env", - "@babel/preset-react" - ], - "plugins": [ - ["@babel/plugin-proposal-class-properties", { "loose": true }], - "@babel/plugin-proposal-optional-chaining", - "@babel/plugin-proposal-object-rest-spread", - "@babel/plugin-proposal-export-default-from" - ], - "env": { - "module": { - "presets": [ - ["@babel/preset-env", { - "modules": false, - }] - ], - "plugins": [ - "./plugins/babel/stylus" - ], - "ignore": [ - "node_modules/**" - ] - }, - } -} diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 000000000..3889c875d --- /dev/null +++ b/babel.config.js @@ -0,0 +1,42 @@ +module.exports = { + presets: [ + ['@babel/preset-env', { + corejs: 3, + useBuiltIns: 'usage', + targets: { + browsers: [ + 'last 2 versions', + 'not ie >= 0', + 'not ie_mob >= 0', + 'not dead', + ], + }, + }], + '@babel/preset-react', + ], + plugins: [ + ['@babel/plugin-transform-runtime', { + corejs: 3, + }], + ['@babel/plugin-proposal-class-properties', { + loose: true, + }], + ], + env: { + ie: { + presets: [ + ['@babel/preset-env', { + corejs: 3, + useBuiltIns: 'usage', + targets: { + browsers: [ + 'last 2 versions', + 'ie >= 11', + 'not dead', + ], + }, + }], + ], + }, + }, +}; diff --git a/package.json b/package.json index d0c610758..3dc61197e 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,8 @@ "webpack-merge": "4.2.2" }, "dependencies": { + "@babel/runtime-corejs3": "^7.9.6", + "core-js": "^3.6.5", "prop-types": "^15.7.2" }, "scripts": {