react-scan
react-scan copied to clipboard
transpile to es2018
I've been using react-scan
in a project with a legacy webpack 4 build, and noticed that the NPM dist uses modern syntax that can't be parsed. To work around, I've been running react-scan
through babel-loader, but this PR should fix the problem.
It seems that webpack 4 uses acorn@6 to parse JS, and that it only supports es2018 syntax^1. Changing the compilation target for esnext
to es2018
fixes the issue, and doesn't affect the build size too much (52kb -> 54kb).
Tested with a trivial webpack 4 config:
Before | After |
---|---|