From 0816001c5f0b24aa7d535017d97d4486e3051b6c Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 13 Jun 2020 14:44:33 -0700 Subject: [PATCH] Add transform-object-rest-spread to list of Babel plugins 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 | 3 ++- README | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.babelrc b/.babelrc index b182744..b9db511 100644 --- 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 1afb559..a692139 100644 --- 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 -- 2.43.0