From c8187472b0f0f8b7bfc7f0b493789f64a3357e67 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 29 Nov 2021 17:25:59 +0100 Subject: [PATCH] build: force use of `@babel/plugin-proposal-optional-chaining` --- babel.config.js | 5 ++++- package.json | 1 + yarn.lock | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index 3c563b0f8b..5d811c9e0a 100644 --- a/babel.config.js +++ b/babel.config.js @@ -7,7 +7,10 @@ module.exports = (api) => { return { presets: [ ['@babel/preset-env', { - include: ['@babel/plugin-proposal-nullish-coalescing-operator'], + include: [ + '@babel/plugin-proposal-nullish-coalescing-operator', + '@babel/plugin-proposal-optional-chaining', + ], loose: true, targets, useBuiltIns: false, // Don't add polyfills automatically. diff --git a/package.json b/package.json index 817245baab..e307ce4534 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "@babel/eslint-parser": "^7.11.3", "@babel/eslint-plugin": "^7.11.3", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5", + "@babel/plugin-proposal-optional-chaining": "^7.16.0", "@babel/plugin-transform-react-jsx": "^7.10.4", "@babel/preset-env": "^7.14.7", "@babel/register": "^7.10.5", diff --git a/yarn.lock b/yarn.lock index 74c7e2da77..48c3a20d2d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -42265,6 +42265,7 @@ hexo-filter-github-emojis@arturi/hexo-filter-github-emojis: "@babel/eslint-parser": ^7.11.3 "@babel/eslint-plugin": ^7.11.3 "@babel/plugin-proposal-nullish-coalescing-operator": ^7.14.5 + "@babel/plugin-proposal-optional-chaining": ^7.16.0 "@babel/plugin-transform-react-jsx": ^7.10.4 "@babel/preset-env": ^7.14.7 "@babel/register": ^7.10.5