1.0.2 • Published 4 years ago

acorn-with-stage3 v1.0.2

Weekly downloads
275
License
MIT
Repository
github
Last release
4 years ago

acorn-with-stage3

When we use the features in stage3 without babel plugins, the webpack will give an error similar to the following

ERROR in ./index.js 2:9
Module parse failed: Unexpected token (2:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| class Rectangle {
>   height = 0;
|   width;
|

In the package.json file resolutions section, declare that the acorn-with-stage3 package is used to replace the acorn package that the webpack uses as a parser.

package.json:

{
  ...
  "resolutions": {
    "acorn": "npm:acorn-with-stage3"
  },
  "dependencies": {

important note: "resolutions" works with yarn (selective dependency resolutions). To use with npm: https://github.com/rogeriochaves/npm-force-resolutions

./example

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago