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 |
|---|---|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| react-scan | ⬜️ Skipped (Inspect) | Dec 6, 2024 0:00am |
Someone is attempting to deploy a commit to the Million Team on Vercel.
A member of the Team first needs to authorize it.