build: Add @babel/plugin-proposal-nullish-coalescing-operator babel plugin

Forces Babel to transplile `??` to ES6 syntax.
This commit is contained in:
Antoine du Hamel 2021-08-02 15:28:34 +02:00
parent 0760be8cc4
commit 4bbd3b97b6
3 changed files with 3 additions and 0 deletions

View file

@ -7,6 +7,7 @@ module.exports = (api) => {
return {
presets: [
['@babel/preset-env', {
include: ['@babel/plugin-proposal-nullish-coalescing-operator'],
loose: true,
targets,
useBuiltIns: false, // Don't add polyfills automatically.

1
package-lock.json generated
View file

@ -21,6 +21,7 @@
"@babel/core": "^7.14.6",
"@babel/eslint-parser": "^7.11.3",
"@babel/eslint-plugin": "^7.11.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
"@babel/plugin-transform-react-jsx": "^7.10.4",
"@babel/preset-env": "^7.14.7",
"@babel/register": "^7.10.5",

View file

@ -40,6 +40,7 @@
"@babel/core": "^7.14.6",
"@babel/eslint-parser": "^7.11.3",
"@babel/eslint-plugin": "^7.11.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
"@babel/plugin-transform-react-jsx": "^7.10.4",
"@babel/preset-env": "^7.14.7",
"@babel/register": "^7.10.5",