Compile object rest and spread properties to ES5. This plugin transforms rest properties in destructuring patterns and spread properties in object literals, enabling use of these ES2018 features in older environments. Version 6.26.0 is the last v6 release, now deprecated in favor of @babel/plugin-proposal-object-rest-spread (Babel 7). The plugin uses Babel's extends helper by default, but can be configured to use Object.assign via the useBuiltIns option. It supports both CommonJS and AMD module formats.
npm install babel-plugin-transform-object-rest-spreadNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Setup Babel plugin and demonstrate object rest & spread transformation.
Upgrade to @babel/plugin-proposal-object-rest-spread for Babel 7.
Include a polyfill for Object.assign when setting useBuiltIns: true.
Use babel-plugin-transform-object-rest-spread only for object literals and destructuring; for function params use babel-plugin-transform-es2015-parameters.
npm install --save-dev babel-plugin-transform-object-rest-spread
Use the unscoped version: babel-plugin-transform-object-rest-spread@6.26.0 (npm install --save-dev babel-plugin-transform-object-rest-spread@6)