-
Notifications
You must be signed in to change notification settings - Fork 122
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
Support swc ts-node option. #302
base: master
Are you sure you want to change the base?
Conversation
@wclr Could you take a look at this PR? It should be fairly minor. |
Keen to try this out! We've got a large code base that takes ~30s to startup right now and would love to cut that down. |
+1 |
Any progress on this? |
ts-node can pull all of these options from your tsconfig.json, is there some reason that can't be done when using ts-node-dev? https://typestrong.org/ts-node/docs/configuration#via-tsconfigjson-recommended |
Any updates here? This would also reduce our build times by quite a bit |
+1 |
If you want an alternative solution, I've switched ts-node-dev to https://github.com/esbuild-kit/tsx, it's great! :) ts-node-dev was always causing problems (high CPU, compatibility macOS/Linux) and I wanted a tool that combined watching and transpiling (so that I didn't have to install something like nodemon) Example: (I'm unaffiliated with tsx) |
@wclr Could you take a look at this PR? Basically, we cannot use this tool with ts-node + swc, since it overrides the transpileOnly property. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The chosen option alias is not present in the ts-node
docs.
@@ -37,6 +38,7 @@ const tsNodeFlags = { | |||
|
|||
const tsNodeAlias = { | |||
'transpile-only': 'T', | |||
'swc': 'W', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from what I can see in the official docs, ts-node does not use -W
short flag for swc, there's only a full --swc
option
@@ -203,7 +203,8 @@ export const makeCompiler = ( | |||
emit: options['emit'], | |||
files: options['files'], | |||
pretty: options['pretty'], | |||
transpileOnly: options['transpile-only'], | |||
transpileOnly: options['transpile-only'] ? true : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the original options['transpile-only']
assignment not working properly? Is there an edge case that had to be resolved with a ternary operator?
No description provided.