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

transformers support #219

Open
rifler opened this issue Aug 4, 2022 · 0 comments
Open

transformers support #219

rifler opened this issue Aug 4, 2022 · 0 comments

Comments

@rifler
Copy link

rifler commented Aug 4, 2022

Hello!

As you probably know, TypeScript has Compiler API, which allows to create "transformers" - functions in which you get control over AST and change it as you wish.
Unfortunately, to use this transformers you should completely duplicate the whole tsc command yourself. It is inconvenient.
Feature request to implement support for transformers right into tsconfig.json - microsoft/TypeScript#14419

Fortunately, there are some solutions, which patch tsc command and make it to respect transformers defined it tsconfig.json. So they are executed at build time. I guess the most popular tool is ttypescript.

Also, there are several packages quite similar to tsconfig-paths, which provides ttypescript support for build-time paths transformations, for instance:
https://github.com/OniVe/ts-transform-paths
https://github.com/zerkalica/zerollup/tree/master/packages/ts-transform-paths
https://github.com/LeDDGroup/typescript-transform-paths

But they are not so popular, tested and maintained as tsconfig-paths.

I suppose it would be great to export ready transformer from tsconfig-paths. This would allow to dramatically cut off entropy and produce path's transformations during build time.

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

1 participant