Prechádzať zdrojové kódy

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

Forces Babel to transplile `??` to ES6 syntax.
Antoine du Hamel 3 rokov pred
rodič
commit
4bbd3b97b6
3 zmenil súbory, kde vykonal 3 pridanie a 0 odobranie
  1. 1 0
      babel.config.js
  2. 1 0
      package-lock.json
  3. 1 0
      package.json

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

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

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