cevek / ttypescript

Over TypeScript tool to use custom transformers in the tsconfig.json
1.53k stars 56 forks source link

Document that ttypescript does not work with ts-node with transpile-only option #123

Closed jasonkuhrt closed 2 years ago

jasonkuhrt commented 3 years ago

I discovered that with transpileOnly option enabled that typescript-transform-paths does not work.

I assume this is not specific to typescript-transform-paths and general to ttypescript.

If so a disclaimer about this should be added to the readme. Easy way to lose some time or give up altogether.

nonara commented 3 years ago

@jasonkuhrt Hi Jason. I'm the maintainer of that library. As of v3.1, we had to switch resolution strategy to a compiler function which requires an EmitHost. I did not consider ts-node's transpileOnly.

Please post an issue over there, and I'll address it.

patroza commented 3 years ago

We had a similar case with another plugin. After discovery it seemed to make sense however :)

nonara commented 3 years ago

After discovery it seemed to make sense however :)

Glad to hear it. I didn't think it'd be too broad, as few people use programmatic compiler API to make use of transpile, however, I hadn't considered that ts-node uses this also. The good news is, very little of the EmitHost is used, so I can easily put together a functional host to fall back on.

jasonkuhrt commented 3 years ago

@nonara done https://github.com/LeDDGroup/typescript-transform-paths/issues/123 🙏

And that would be great because the perf difference of --transpileOnly is huge (at least in our case).

nonara commented 3 years ago

Agreed! Type checking is the most expensive part of the compilation process. I wasn't aware that anyone was using the extension without. Will have a look at this hopefully this weekend

nonara commented 3 years ago

Just finished. New version will release soon.

Just wondering what the use case looks like for you guys?

It should be able to run without the transformer via tsconfig-paths. (ie. ts-node -T -r tsconfig-paths/register)

Are you actually emitting source with ts-node?

zyf0330 commented 3 years ago

Just wondering what the use case looks like for you guys?

It should be able to run without the transformer via tsconfig-paths. (ie. ts-node -T -r tsconfig-paths/register)

Are you actually emitting source with ts-node?

Just don't want to use another tool to play with ts-node.

jasonkuhrt commented 3 years ago

Are you actually emitting source with ts-node?

Nope not emitting, just running scripts.

nonara commented 3 years ago

Support added in v3.2.0

nonara commented 3 years ago

Nope not emitting, just running scripts.

Ah, ok. Performance-wise, I'm thinking tsconfig-paths will probably be faster for you, but if you're using any of the special features like custom tags, exclusion options, etc. you should be able to use the plugin with transpileOnly now.

If anything doesn't work properly, please let me know!

jasonkuhrt commented 3 years ago

Ah, ok. Performance-wise, I'm thinking tsconfig-paths will probably be faster for you

Interesting, at that point I think the issue is about project complexity, more setup/deps etc.