Skip to content

Commit

Permalink
Use external @babel/runtime helpers
Browse files Browse the repository at this point in the history
Fixes #302
  • Loading branch information
realityking committed Jan 26, 2021
1 parent a8edd64 commit aca1b4e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/preset-react": "^7.12.5",
"@rollup/plugin-babel": "^5.2.1",
"@types/react": "^15.0.21",
"babel-loader": "^8.0.0",
Expand Down Expand Up @@ -78,6 +79,7 @@
"scrollspy"
],
"dependencies": {
"@babel/runtime": "^7.12.5",
"consolidated-events": "^1.1.0 || ^2.0.0",
"prop-types": "^15.0.0",
"react-is": "^17.0.1"
Expand Down
30 changes: 26 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import babel from '@rollup/plugin-babel';
import babel, { getBabelOutputPlugin } from '@rollup/plugin-babel';
import pkg from './package.json';

export default [
Expand All @@ -9,14 +9,36 @@ export default [
...Object.keys(pkg.peerDependencies),
],
output: [
{ file: pkg.main, format: 'cjs' },
{ file: pkg.module, format: 'es' },
{
file: pkg.main,
format: 'cjs',
plugins: [getBabelOutputPlugin({
presets: [['airbnb', {
modules: false,
runtimeVersion: '7.12.5',
runtimeHelpersUseESModules: false
}]]
})]
},
{
file: pkg.module,
format: 'es',
plugins: [getBabelOutputPlugin({
presets: [['airbnb', {
modules: false,
runtimeVersion: '7.12.5',
runtimeHelpersUseESModules: true
}]]
})]
},
],
plugins: [
babel({
babelrc: false,
babelHelpers: 'bundled',
presets: ['@babel/preset-react'],
exclude: ['node_modules/**'],
}),
})
],
},
];

0 comments on commit aca1b4e

Please sign in to comment.