How to use preset-env in ES2020 #15609
-
According to the docs, babel-plugin-proposal-nullish-coalescing-operator is included in babel/preset-env in ES2020. But what does this mean? How can it be enabled? I added
And still I keep getting errors like:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Your target already supports If you are stuck at webpack 4, you can use ["@babel/preset-env", { "include": [ "proposal-optional-chaining" ] }] |
Beta Was this translation helpful? Give feedback.
Your target already supports
?.
, that's whypreset-env
does not enable the transform for you. However, in your case, the webpack 4 does not support it. Please upgrade to webpack 5.If you are stuck at webpack 4, you can use
include
to always enable?.
transform, though the output code will be slightly bigger than what it supposed to be.