1.0.1 • Published 6 years ago

@sucrase/webpack-object-rest-spread-plugin v1.0.1

Weekly downloads
529
License
MIT
Repository
github
Last release
6 years ago

Webpack object rest/spread plugin

npm version MIT License

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(),
  ],
}