fix: use @babel/preset-env with bugfixes for modern builds - #702
Conversation
🦋 Changeset is good to goLatest commit: 14411d1 We got this. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| }; | ||
| const presetEnvRegex = RegExp(/@babel\/(preset-)?env/); | ||
| const environmentPreset = '@babel/preset-env'; |
There was a problem hiding this comment.
This no longer finds @babel/env, which is an alias of @babel/preset-env
There was a problem hiding this comment.
Oh I searched for it and couldn't find any usage of it. i'll create a follow up PR
There was a problem hiding this comment.
Heh - yeah we don't have a test for it, just it's possible to get that value when we read in user config.
| }, | ||
| preset.options, | ||
| { | ||
| bugfixes: customOptions.modern, |
There was a problem hiding this comment.
This can just always be set to true, it has no effect on cases where the output is below the affected syntax level.
jdpigeon
commented
Aug 28, 2020
🎉 thank you! |
quantizor
commented
Sep 6, 2020
Can this be released? Just ran into #522 and wasted some time... |
This PR removes the usage of
@babel/preset-modulesand use@babel/preset-envwith the bugfixes flag when bundling for modern browsers.This enables "Optional chaining" and "nullish coalescing" by default without a babelrc override.
Fixes#522
Fixes#694