Skip to content

how to use ts-transformers by esbuild or vitejs ? #2193

Answered by aomarks
suyouwanggang asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think you can use the Lit TypeScript transformers with esbuild directly (and hence vite, because vite uses esbuild to compile TypeScript). I don't see any options for transformers listed at https://esbuild.github.io/content-types/#typescript, plus the Lit transformers require access to the type checker for analysis, and esbuild does not include a TypeScript type checker.

So, I believe you would need to pre-process your TypeScript using one of the methods documented in the ts-transformers README before passing it on to esbuild/vite.

Out of curiosity, why are you interested in using the Lit transformers in your project?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aomarks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants