Move typescript compilation to esbuild and run babel on the output #859
Labels
kind: feature
New feature or request
problem: stale
Issue has not been responded to in some time
solution: duplicate
This issue or pull request already exists
solution: wontfix
This will not be worked on
Current Behavior
Tsdx doesn’t correctly transpile typescript thanks to upstream issues with Babel transform async to promises. The project appears to be dead.
Desired Behavior
Tsdx transpires typescript perfectly.
Suggested Solution
Write our own typescript rollup plugin that uses esbuild
Who does this impact? Who is this for?
Everyone
Describe alternatives you've considered
Additional context
I spoke with Evan You (inventor of Vue.js) privately about how he uses esbuild to power vite. He shared this technique with me. Basically, esbuild is really really really good and fast for typescript compilation. Its minifier, however, is significantly worse than terser according to Evan’s benchmarks. Thus, he suggested we implement it as a custom rollup plugin and keep the rest of the rollup pipeline for assets etc. Vite doesn’t use babel, however, we could still support it by running it after transpilation. Lastly, esbuild doesn’t type check, so we will want to take care of type checking on build and on watch.
On my phone right now, but this relates to several
open issues. Feel free to update this with more. #684 #795
The text was updated successfully, but these errors were encountered: