how to use ts-transformers by esbuild or vitejs ? #2193
-
how to use ts-transformers by esbuild or vitejs ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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? |
Beta Was this translation helpful? Give feedback.
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?