From 4bbd3b97b675af98722d14b9e384446de7ea2c49 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 2 Aug 2021 15:28:34 +0200 Subject: [PATCH] build: Add `@babel/plugin-proposal-nullish-coalescing-operator` babel plugin Forces Babel to transplile `??` to ES6 syntax. --- babel.config.js | 1 + package-lock.json | 1 + package.json | 1 + 3 files changed, 3 insertions(+) diff --git a/babel.config.js b/babel.config.js index 6504c4c5f..8b80ec2a4 100644 --- a/babel.config.js +++ b/babel.config.js @@ -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. diff --git a/package-lock.json b/package-lock.json index 4cf429729..4bb1b1017 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 09fd689e2..6cf401ecf 100644 --- a/package.json +++ b/package.json @@ -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",