-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES5 transpilation on typescript #2436
Comments
After some tests, it appears that the code is always transpiled to ES5 when the source is a typescript file , if the file is javascript, the code is properly transpiled using the |
After some more tinkering i finally found the solution to prevent typescript from transpiling to es5 {
"compilerOptions": {
"target": "esnext"
}
} |
THANK YOU! You helped a lot! |
We should consider applying browserslist or engines.node to typescript (maybe only if that value isn't already set in tsconfig.json). |
See #860 |
🐛 bug report
Parcel ignores engines.node and still transpile the code with babel
🎛 Configuration (.babelrc, package.json, cli command)
package.json
🤔 Expected Behavior
Parcel respect
engines.node
for node just like it respectbrowserslist
for the browser target😯 Current Behavior
The source code is transpiled to ES5 which causes the Foo class to be transpiled to a function and throw
Class constructor JSPackager cannot be invoked without 'new'
I think it's related to #839 but in their case, setting
browserslist
to"last 1 Chrome versions"
fix the problem, but since in my case the target is node,browserlist
is replaced byengines.node
which doesn't work.💻 Code Sample
https://github.com/Banou26/parcel-node-babel
🌍 Your Environment
The text was updated successfully, but these errors were encountered: