From 74ad0328b61202edf244ee934425df7ef4952481 Mon Sep 17 00:00:00 2001 From: Alan Pierce Date: Sat, 9 Jun 2018 15:10:18 -0700 Subject: [PATCH] Update docs to indicate that object rest/spread works in webpack 4 Fixes #225 --- integrations/webpack-loader/README.md | 7 +++---- .../webpack-object-rest-spread-plugin/CHANGELOG.md | 7 +++++++ integrations/webpack-object-rest-spread-plugin/README.md | 9 +++++---- .../webpack-object-rest-spread-plugin/package.json | 5 ++++- 4 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 integrations/webpack-object-rest-spread-plugin/CHANGELOG.md diff --git a/integrations/webpack-loader/README.md b/integrations/webpack-loader/README.md index 3d5d9bb0..300bb490 100644 --- a/integrations/webpack-loader/README.md +++ b/integrations/webpack-loader/README.md @@ -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 diff --git a/integrations/webpack-object-rest-spread-plugin/CHANGELOG.md b/integrations/webpack-object-rest-spread-plugin/CHANGELOG.md new file mode 100644 index 00000000..b7abb995 --- /dev/null +++ b/integrations/webpack-object-rest-spread-plugin/CHANGELOG.md @@ -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 diff --git a/integrations/webpack-object-rest-spread-plugin/README.md b/integrations/webpack-object-rest-spread-plugin/README.md index 9136aadb..4e67d4e9 100644 --- a/integrations/webpack-object-rest-spread-plugin/README.md +++ b/integrations/webpack-object-rest-spread-plugin/README.md @@ -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 diff --git a/integrations/webpack-object-rest-spread-plugin/package.json b/integrations/webpack-object-rest-spread-plugin/package.json index 34240d7f..7714a8fe 100644 --- a/integrations/webpack-object-rest-spread-plugin/package.json +++ b/integrations/webpack-object-rest-spread-plugin/package.json @@ -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 ", "license": "MIT", "private": false, + "peerDependencies": { + "webpack": "<4" + }, "dependencies": { "acorn": "^5.3.0", "acorn-dynamic-import": "^3.0.0",