Skip to content

Commit

Permalink
Update docs to indicate that object rest/spread works in webpack 4
Browse files Browse the repository at this point in the history
Fixes #225
  • Loading branch information
alangpierce committed Jun 9, 2018
1 parent 31232fb commit 74ad032
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
7 changes: 3 additions & 4 deletions integrations/webpack-loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
This is a simple Webpack loader that makes it easy to use
[Sucrase](https://github.com/alangpierce/sucrase) in your build.

**Note: Sucrase does not transform object rest/spread syntax (e.g.
`{...a, b: c}`), and the syntax is not yet supported by Webpack. If you use that
syntax, you should use the
**Note: Object rest/spread syntax (e.g. `{...a, b: c}`) requires Webpack 4. For
earlier Webpack versions, you can use
[webpack-object-rest-spread-plugin](https://github.com/alangpierce/sucrase/tree/master/integrations/webpack-object-rest-spread-plugin)
package alongside this loader, and add both to your webpack config.**
alongside this loader.**

## Usage

Expand Down
7 changes: 7 additions & 0 deletions integrations/webpack-object-rest-spread-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 1.0.1 (2018-06-09)

* Add webpack peer dependency to indicate that webpack 4 is unsupported.

# 1.0.0

Initial release
9 changes: 5 additions & 4 deletions integrations/webpack-object-rest-spread-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
[![MIT License](https://img.shields.io/npm/l/express.svg?maxAge=2592000)](LICENSE)

This is a Webpack plugin that hacks the Webpack parser to allow object
rest/spread syntax (e.g. `{...a, b: c}`). If you want to package source code
using this syntax (e.g. when using [Sucrase](https://github.com/alangpierce/sucrase)),
you'll need this plugin until Acorn (the parser that Webpack uses) starts
officially supporting the syntax.
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

Expand Down
5 changes: 4 additions & 1 deletion integrations/webpack-object-rest-spread-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"name": "@sucrase/webpack-object-rest-spread-plugin",
"version": "1.0.0",
"version": "1.0.1",
"description": "Webpack plugin to enable object rest/spread syntax",
"main": "dist/index.js",
"repository": "https://github.com/alangpierce/sucrase/tree/master/integrations/webpack-object-rest-spread-plugin",
"author": "Alan Pierce <[email protected]>",
"license": "MIT",
"private": false,
"peerDependencies": {
"webpack": "<4"
},
"dependencies": {
"acorn": "^5.3.0",
"acorn-dynamic-import": "^3.0.0",
Expand Down

0 comments on commit 74ad032

Please sign in to comment.