Closed nparoski closed 1 year ago
@nparoski If you add a .swcrc
file in apps/game
with the following then it should work:
{
"jsc": {
"target": "es2016"
}
}
The reason why tsconfig didn't work is because SWC does not use the target
defined there. Maybe we need to generate this file by default to it's more obvious.
@jaysoo Thanks error is resolved, I would very much appreciate if you guys can add .swcrc
at root of app/lib and/or document it. As this was very much a blocker.
Thanks for the fast reply.
Yes, we will generate it with defaults so it is more clear on where to change the target. I'll see if we need to add this to docs as well.
@jaysoo what is the purpose of .babelrc in root if swc is used?
There is no purpose. Looks like a bug in the @nx/web:app
generator that we need to patch.
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
I keep getting error in console because of usage of es6 classes and code gets transpiled to es5
I have player.ts
Which compiles to
Expected Behavior
I expect with tsconfig.json
compilerOptions.target = es6
to get something similar to:GitHub Repo
https://github.com/nparoski/web-game/tree/feature/es6-classes
Steps to Reproduce
es6
instead ofes2015
Nx Report
Failure Logs
No response
Operating System
Additional Information
No response