瀏覽代碼

deps: add babel plugins for optional chaining and nullish coalescing

They are in Stage 3 and are already dependencies or the React Native preset.

References:
https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining
https://babeljs.io/docs/en/babel-plugin-proposal-nullish-coalescing-operator
master
Saúl Ibarra Corretgé 5 年之前
父節點
當前提交
abefc56750
共有 3 個文件被更改,包括 20 次插入18 次删除
  1. 14
    14
      package-lock.json
  2. 2
    0
      package.json
  3. 4
    4
      webpack.config.js

+ 14
- 14
package-lock.json 查看文件

@@ -1574,12 +1574,12 @@
1574 1574
       }
1575 1575
     },
1576 1576
     "@babel/plugin-proposal-nullish-coalescing-operator": {
1577
-      "version": "7.0.0",
1578
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.0.0.tgz",
1579
-      "integrity": "sha512-QIN3UFo1ul4ruAsjIqK43PeXedo1qY74zeGrODJl1KfCGeMc6qJC4rb5Ylml/smzxibqsDeVZGH+TmWHCldRQQ==",
1577
+      "version": "7.4.4",
1578
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.4.4.tgz",
1579
+      "integrity": "sha512-Amph7Epui1Dh/xxUxS2+K22/MUi6+6JVTvy3P58tja3B6yKTSjwwx0/d83rF7551D6PVSSoplQb8GCwqec7HRw==",
1580 1580
       "requires": {
1581 1581
         "@babel/helper-plugin-utils": "^7.0.0",
1582
-        "@babel/plugin-syntax-nullish-coalescing-operator": "^7.0.0"
1582
+        "@babel/plugin-syntax-nullish-coalescing-operator": "^7.2.0"
1583 1583
       }
1584 1584
     },
1585 1585
     "@babel/plugin-proposal-object-rest-spread": {
@@ -1601,12 +1601,12 @@
1601 1601
       }
1602 1602
     },
1603 1603
     "@babel/plugin-proposal-optional-chaining": {
1604
-      "version": "7.0.0",
1605
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.0.0.tgz",
1606
-      "integrity": "sha512-7x8HLa71OzNiofbQUVakS0Kmg++6a+cXNfS7QKHbbv03SuSaumJyaWsfNgw+T7aqrJlqurYpZqrkPgXu0iZK0w==",
1604
+      "version": "7.2.0",
1605
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.2.0.tgz",
1606
+      "integrity": "sha512-ea3Q6edZC/55wEBVZAEz42v528VulyO0eir+7uky/sT4XRcdkWJcFi1aPtitTlwUzGnECWJNExWww1SStt+yWw==",
1607 1607
       "requires": {
1608 1608
         "@babel/helper-plugin-utils": "^7.0.0",
1609
-        "@babel/plugin-syntax-optional-chaining": "^7.0.0"
1609
+        "@babel/plugin-syntax-optional-chaining": "^7.2.0"
1610 1610
       }
1611 1611
     },
1612 1612
     "@babel/plugin-proposal-unicode-property-regex": {
@@ -1688,9 +1688,9 @@
1688 1688
       }
1689 1689
     },
1690 1690
     "@babel/plugin-syntax-nullish-coalescing-operator": {
1691
-      "version": "7.0.0",
1692
-      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.0.0.tgz",
1693
-      "integrity": "sha512-oAJmMsAvTSIk9y0sZdU2S/nY44PEUuHN7EzNDMgbuR4e/OwyfR9lSmoBJBZ2lslFZIqhksrTt4i+av7uKfNYDw==",
1691
+      "version": "7.2.0",
1692
+      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.2.0.tgz",
1693
+      "integrity": "sha512-lRCEaKE+LTxDQtgbYajI04ddt6WW0WJq57xqkAZ+s11h4YgfRHhVA/Y2VhfPzzFD4qeLHWg32DMp9HooY4Kqlg==",
1694 1694
       "requires": {
1695 1695
         "@babel/helper-plugin-utils": "^7.0.0"
1696 1696
       }
@@ -1712,9 +1712,9 @@
1712 1712
       }
1713 1713
     },
1714 1714
     "@babel/plugin-syntax-optional-chaining": {
1715
-      "version": "7.0.0",
1716
-      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.0.0.tgz",
1717
-      "integrity": "sha512-QXedQsZf8yua1nNrXSePT0TsGSQH9A1iK08m9dhCMdZeJaaxYcQfXdgHWVV6Cp7WE/afPVvSKIsAHK5wP+yxDA==",
1715
+      "version": "7.2.0",
1716
+      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.2.0.tgz",
1717
+      "integrity": "sha512-HtGCtvp5Uq/jH/WNUPkK6b7rufnCPLLlDAFN7cmACoIjaOOiXxUt3SswU5loHqrhtqTsa/WoLQ1OQ1AGuZqaWA==",
1718 1718
       "requires": {
1719 1719
         "@babel/helper-plugin-utils": "^7.0.0"
1720 1720
       }

+ 2
- 0
package.json 查看文件

@@ -94,6 +94,8 @@
94 94
     "@babel/plugin-proposal-class-properties": "7.1.0",
95 95
     "@babel/plugin-proposal-export-default-from": "7.0.0",
96 96
     "@babel/plugin-proposal-export-namespace-from": "7.0.0",
97
+    "@babel/plugin-proposal-nullish-coalescing-operator": "7.4.4",
98
+    "@babel/plugin-proposal-optional-chaining": "7.2.0",
97 99
     "@babel/plugin-transform-flow-strip-types": "7.0.0",
98 100
     "@babel/preset-env": "7.1.0",
99 101
     "@babel/preset-flow": "7.0.0",

+ 4
- 4
webpack.config.js 查看文件

@@ -45,10 +45,10 @@ const config = {
45 45
                 plugins: [
46 46
                     require.resolve('@babel/plugin-transform-flow-strip-types'),
47 47
                     require.resolve('@babel/plugin-proposal-class-properties'),
48
-                    require.resolve(
49
-                        '@babel/plugin-proposal-export-default-from'),
50
-                    require.resolve(
51
-                        '@babel/plugin-proposal-export-namespace-from')
48
+                    require.resolve('@babel/plugin-proposal-export-default-from'),
49
+                    require.resolve('@babel/plugin-proposal-export-namespace-from'),
50
+                    require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'),
51
+                    require.resolve('@babel/plugin-proposal-optional-chaining')
52 52
                 ],
53 53
                 presets: [
54 54
                     [

Loading…
取消
儲存