Add transform-object-rest-spread to list of Babel plugins
authorCarl Worth <cworth@cworth.org>
Sat, 13 Jun 2020 21:44:33 +0000 (14:44 -0700)
committerCarl Worth <cworth@cworth.org>
Sat, 13 Jun 2020 22:01:03 +0000 (15:01 -0700)
This allows for using the object spread syntax in the source, such as:

updated_players = {...players, id: {name: "player-name"}}

which babel will transform to something else for us.

.babelrc
README

index b182744c4ffad8c8cfa3edf7b07f5fea86769352..b9db511f14d44141aaab814b7b2b6b72feeea229 100644 (file)
--- a/.babelrc
+++ b/.babelrc
@@ -6,7 +6,8 @@
     "development": {
       "plugins": [
         "transform-react-jsx-self",
-        "transform-react-jsx-source"
+        "transform-react-jsx-source",
+        "transform-object-rest-spread"
       ]
     }
   }
diff --git a/README b/README
index 1afb559523710c3909064c81fed7ae140cc92007..a692139aa6da7c5ced84ec6271fb4a0764520475 100644 (file)
--- a/README
+++ b/README
@@ -16,7 +16,10 @@ code:
 Dependencies
 ------------
 Compiling the source requires the babel (version 6) CLI to be
-available as "babeljs" along with the "react" preset. This can be
-achieved on Debian with:
+available as "babeljs" along with the "react" preset and support for
+"object spread" syntax. This can be achieved on Debian with:
 
-       sudo apt install node-babel-cli node-babel-preset-react
+       sudo apt install \
+                 node-babel-cli \
+                 node-babel-preset-react \
+                 node-babel-plugin-transform-object-rest-spread