Closed johannes-z closed 4 years ago
It's because in packages/consumer/rollup.config.js
you are only excluding consumer
's node_module
s, but core-js
comes from the top-level node_modules
. For this reason, Babel injects imports to core-js
in core-js
itself, causing problems.
You can fix it by using exclude: /node_modules/
, which will ignore all the node_modules
folders.
Thanks, that was it.
My final bundle has a lot of statements like the following, even though I'm using
@rollup/plugin-node-resolve
and@rollup/plugin-commonjs
:I've created a repro here: https://github.com/johannes-z/rollup-babel-yarn This is the bundle generated: https://github.com/johannes-z/rollup-babel-yarn/blob/master/packages/consumer/lib/main.js
For babel I'm using
@babel/preset-env
withuseBuiltIns: 'usage'
, so thatPromise
gets polyfilled as well.Ref: https://github.com/rollup/rollup-plugin-babel/issues/312