diff --git a/rollup.config.js b/rollup.config.js index e003c1b2..c5c62cb9 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,6 @@ import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; -// import babel from '@rollup/plugin-babel'; +import babel from '@rollup/plugin-babel'; import postcss from 'rollup-plugin-postcss'; import bundleSize from 'rollup-plugin-bundle-size'; import replace from '@rollup/plugin-replace'; @@ -15,7 +15,7 @@ const processEnv = isProd || isTesting ? 'production' : 'development'; export const baseConfig = ({ mainFile = pkg.main, moduleFile = pkg.module, injectCSS = true } = {}) => ({ input: 'src/index.ts', - external: ['react', 'react-dom'], + external: ['react', 'react-dom', (id) => id.includes('@babel/runtime')], onwarn(warning, rollupWarn) { if (warning.code !== 'CIRCULAR_DEPENDENCY') { rollupWarn(warning); @@ -39,8 +39,6 @@ export const baseConfig = ({ mainFile = pkg.main, moduleFile = pkg.module, injec replace({ __ENV__: JSON.stringify(processEnv), __REACT_FLOW_VERSION__: JSON.stringify(pkg.version), - // this comes from the easy-peasy dependency - 'process.env.FORCE_SIMILAR_INSTEAD_OF_MAP': false, preventAssignment: true, }), bundleSize(), @@ -48,15 +46,15 @@ export const baseConfig = ({ mainFile = pkg.main, moduleFile = pkg.module, injec minimize: isProd, inject: injectCSS, }), - // babel({ - // exclude: 'node_modules/**', - // babelHelpers: 'runtime', - // }), + babel({ + exclude: 'node_modules/**', + babelHelpers: 'runtime', + }), svgr(), + resolve(), typescript({ clean: true, }), - resolve(), commonjs({ include: 'node_modules/**', }),