ES2015 spread transform · Babel


#1

Compile ES2015 spread to ES5

.babelrc


This is a companion discussion topic for the original entry at https://babeljs.io/docs/plugins/transform-es2015-spread/

#2

The examples are old, maybe? I guess transform-es2015-spread cannot handle the object spread operator, which is in fact handled by object-rest-spread.

https://github.com/babel/babel/tree/7.0/packages/babel-plugin-transform-es2015-spread

README in the repo above also only includes array cases.


#3

As @noraesae mentioned transform-es2015-spread is usually for Arrays if you would like to the same for objets you need the babel-plugin-transform-object-rest-spread plugin.