Browse Source

build: force use of `@babel/plugin-proposal-optional-chaining` (#3335)

Antoine du Hamel 3 years ago
parent
commit
78268d00fd
3 changed files with 6 additions and 1 deletions
  1. 4 1
      babel.config.js
  2. 1 0
      package.json
  3. 1 0
      yarn.lock

+ 4 - 1
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.

+ 1 - 0
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",

+ 1 - 0
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