diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 66f59e1..0000000 --- a/.babelrc +++ /dev/null @@ -1,49 +0,0 @@ -{ - "env": { - "cjs": { - "presets": [ - "@babel/preset-env", - "@babel/preset-react" - ], - "plugins": [ - "@babel/plugin-proposal-class-properties", - "@babel/plugin-transform-runtime", - [ - "transform-react-remove-prop-types", - { - "mode": "wrap" - } - ] - ], - "generatorOpts": { - "concise": true - } - }, - "es2015": { - "presets": [ - [ - "@babel/preset-env", - { - "modules": false, - "loose": true - } - ], - "@babel/preset-react" - ], - "plugins": [ - "@babel/plugin-syntax-dynamic-import", - "@babel/plugin-proposal-class-properties", - ["@babel/plugin-transform-runtime", { "useESModules": true }], - [ - "transform-react-remove-prop-types", - { - "mode": "wrap" - } - ] - ], - "generatorOpts": { - "concise": true - } - } - } -} diff --git a/.babelrc.js b/.babelrc.js new file mode 100644 index 0000000..523a880 --- /dev/null +++ b/.babelrc.js @@ -0,0 +1,48 @@ +const shouldPrintComment = (val) => /@license|@preserve|[#@]__PURE__/.test(val); + +module.exports = { + env: { + cjs: { + presets: ["@babel/preset-env", "@babel/preset-react"], + plugins: [ + "@babel/plugin-proposal-class-properties", + "@babel/plugin-transform-runtime", + [ + "transform-react-remove-prop-types", + { + mode: "wrap", + }, + ], + ], + generatorOpts: { + shouldPrintComment, + }, + }, + es2015: { + presets: [ + [ + "@babel/preset-env", + { + modules: false, + loose: true, + }, + ], + "@babel/preset-react", + ], + plugins: [ + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-proposal-class-properties", + ["@babel/plugin-transform-runtime", { useESModules: true }], + [ + "transform-react-remove-prop-types", + { + mode: "wrap", + }, + ], + ], + generatorOpts: { + shouldPrintComment, + }, + }, + }, +};