Skip to content

Commit 6387e92

Browse files
authored
fix: add @babel/runtime to externals for cjs and es formats (#104)
Resolves #102
1 parent b475c23 commit 6387e92

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rollup.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ const EXTERNAL = [
4545
'prop-types',
4646
];
4747

48+
// https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers
49+
const CJS_AND_ES_EXTERNALS = EXTERNAL.concat(/@babel\/runtime/);
50+
4851
const OUTPUT_DATA = [
4952
{
5053
file: pkg.browser,
@@ -68,7 +71,7 @@ const config = OUTPUT_DATA.map(({ file, format }) => ({
6871
name: OUTPUT_NAME,
6972
globals: GLOBALS,
7073
},
71-
external: EXTERNAL,
74+
external: ['cjs', 'es'].includes(format) ? CJS_AND_ES_EXTERNALS : EXTERNAL,
7275
plugins: PLUGINS,
7376
}));
7477

0 commit comments

Comments
 (0)