Closed timkelty closed 4 years ago
Perhaps we should switch from entry
to usage
by default? iirc the reason I didn't use usage
in the past (which upgrading to Babel 7) was that (a) it was more buggy then, (b) it was harder for people to opt out if they didn't need to use a polyfill at all.
However since then, I'm presuming the bugs have been worked out solving (a), and we now dynamically set it to false
based on whether core-js
is found, which resolves (b).
Either way we should probably also now replace the @babel/polyfill
references in the docs with core-js
.
The description of entry vs usage can be seen here.
Perhaps we should switch from entry to usage by default
Sounds like that could be a good move. It used to be noted as "experimental" in Babel docs, but doesn't seem to be any longer.
I just started using it has seemed to work great so far, and dropped my bundle size significantly.
Either way we should probably also now replace the @babel/polyfill references in the docs with core-js.
Yep!
@edmorley I can squeeze in a PR tomorrow if you think changing this to usage
would be good for v9. /cc @neutrinojs/core-contributors
@timkelty yeah let's do it :-)
K, I'll PR today!
AFAIK, if you want to change
@babel/preset-env
'suseBuiltIns
option, you have to pass the preset config in its entirety, e.g.:…would it be worth it to make this easier to change via options (similar to how we have
options.targets
)?