diff --git a/rollup.config.js b/rollup.config.js index c5c62cb9..cc1ab8a1 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -6,6 +6,7 @@ import bundleSize from 'rollup-plugin-bundle-size'; import replace from '@rollup/plugin-replace'; import svgr from '@svgr/rollup'; import typescript from 'rollup-plugin-typescript2'; +import { DEFAULT_EXTENSIONS as DEFAULT_BABEL_EXTENSIONS } from '@babel/core'; import pkg from './package.json'; @@ -46,10 +47,6 @@ export const baseConfig = ({ mainFile = pkg.main, moduleFile = pkg.module, injec minimize: isProd, inject: injectCSS, }), - babel({ - exclude: 'node_modules/**', - babelHelpers: 'runtime', - }), svgr(), resolve(), typescript({ @@ -58,6 +55,11 @@ export const baseConfig = ({ mainFile = pkg.main, moduleFile = pkg.module, injec commonjs({ include: 'node_modules/**', }), + babel({ + extensions: [...DEFAULT_BABEL_EXTENSIONS, '.ts', '.tsx'], + exclude: 'node_modules/**', + babelHelpers: 'runtime', + }), ], }); diff --git a/tsconfig.json b/tsconfig.json index 49d832a7..33a51e49 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,8 +2,8 @@ "compilerOptions": { "outDir": "dist", "module": "esnext", - "target": "es5", - "lib": ["es6", "dom", "es2016", "es2017"], + "target": "esnext", + "lib": ["dom", "esnext"], "jsx": "react", "moduleResolution": "node", "declaration": true,