@sucrase/webpack-object-rest-spread-plugin
v1.0.1
Published
Webpack plugin to enable object rest/spread syntax
Downloads
58
Readme
Webpack object rest/spread plugin
This is a Webpack plugin that hacks the Webpack parser to allow object
rest/spread syntax (e.g. {...a, b: c}
) in Webpack 3 and earlier.
Note: This plugin is only necessary when using Webpack 3 or earlier. Webpack 4 natively supports object rest/spread. See https://github.com/webpack/webpack/issues/5548 for troubleshooting tips.
Usage
First install the package as a dev dependency:
yarn add --dev @sucrase/webpack-object-rest-spread-plugin
Then add it as a plugin to your webpack config:
const ObjectRestSpreadPlugin = require('@sucrase/webpack-object-rest-spread-plugin');
...
plugins: [
new ObjectRestSpreadPlugin(),
],
}