Skip to content
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

Cannot use with ts-node transpile-only #53

Closed
zyf0330 opened this issue Jul 28, 2021 · 5 comments
Closed

Cannot use with ts-node transpile-only #53

zyf0330 opened this issue Jul 28, 2021 · 5 comments

Comments

@zyf0330
Copy link

zyf0330 commented Jul 28, 2021

No description provided.

@nonara
Copy link
Owner

nonara commented Jul 28, 2021

See issue: TypeStrong/ts-node#1051

It is possible to use transformers with ts-node via the register method demonstrated in that issue.

@nonara nonara closed this as completed Jul 28, 2021
@zyf0330
Copy link
Author

zyf0330 commented Jul 28, 2021

I just don't want to use another transformer tool to support ts-node --transpile-only.
Can this problem solved by patch typescript? @nonara

@nonara
Copy link
Owner

nonara commented Jul 28, 2021

At the moment, tsp does not natively patch the method used by ts-node. I will look at adding some sort of support for ts-node in v2.

That said, you don't need another tool to make it work. If you read the thread I posted, they give an example of supplying ts-node with your transformers, so you can make it work with or without patched typescript.

I should point out that most transformer packages for tsp or ttypescript require the type checker, so they will not work with transpile-only. The ones which take a raw signature should work, however.

You can try the one you like to find out. Just provide ts-node with your configuration like they do in the example I posted.

Hope that helps!

@zyf0330
Copy link
Author

zyf0330 commented Jul 28, 2021

Thanks for your explanation!
I use a transformer @zerollup/ts-transform-paths which handles ts path mapping, I guess it doesn't need type checking.

@zyf0330
Copy link
Author

zyf0330 commented Jul 28, 2021

Finally I use ts-node -T -r tsconfig-paths/register for develop, which doesn't need extra config or code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants