Skip to content

Commit

Permalink
Always transform core-js to esm, to fix its internal dependencies not…
Browse files Browse the repository at this point in the history
… being found by the rollup bundler in the external() resolution.
  • Loading branch information
hb-seb committed Aug 16, 2020
1 parent e5b21ac commit 12696aa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/createRollupConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,12 @@ export async function createRollupConfig(
// defaults + .jsx
extensions: ['.mjs', '.js', '.jsx', '.json', '.node'],
}),
opts.format === 'umd' &&
commonjs({
// use a regex to make sure to include eventual hoisted packages
include: /\/node_modules\//,
}),
commonjs({
// Use a regex to make sure to include eventual hoisted packages (umd).
// Always transform core-js, so its internal dependencies are found
// by rollup's external() resolution.
include: opts.format === 'umd' ? /\/node_modules\// : /core-js\//,
}),
json(),
{
// Custom plugin that removes shebang from code because newer
Expand Down

0 comments on commit 12696aa

Please sign in to comment.