Skip to content

Commit

Permalink
Fix bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Feb 29, 2024
1 parent 54ca66f commit cfc3b69
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Gulpfile.mjs
Expand Up @@ -419,6 +419,23 @@ function buildRollup(packages, buildStandalone) {
"packages/babel-compat-data/scripts/data/legacy-plugin-aliases.js",
"packages/*/src/**/*.cjs",
],
ignore:
process.env.STRIP_BABEL_8_FLAG &&
bool(process.env.BABEL_8_BREAKING)
? [
// These require()s are all in babel-preset-env/src/polyfills/babel-7-plugins.cjs
// They are gated by a !process.env.BABEL_8_BREAKING check, but
// @rollup/plugin-commonjs extracts them to import statements outside of the
// check and thus they end up in the final bundle.
// We only bundle @babel/preset-env in Babel 8, so it's safe to just always
// ignore them.
"babel-plugin-polyfill-corejs2",
"babel-plugin-polyfill-regenerator",
"./babel-polyfill.cjs",
"./regenerator.cjs",
"@babel/compat-data/corejs2-built-ins",
]
: [],
dynamicRequireTargets: [
// https://github.com/mathiasbynens/regexpu-core/blob/ffd8fff2e31f4597f6fdfee75d5ac1c5c8111ec3/rewrite-pattern.js#L48
resolveChain(
Expand Down

0 comments on commit cfc3b69

Please sign in to comment.