tsx
tsx copied to clipboard
`swc` as `tsx` compile backend alternative
Feature request
swc as tsx compile backend alternative
Why?
- https://github.com/evanw/esbuild/issues/2605 Since Oct 11, 2022.
esbuildseems have low interest to fix--keep-names - https://github.com/esbuild-kit/tsx/issues/113#issuecomment-1519340330
ts-nodesupportswc, and don't have same problem likeesbuild - https://github.com/TypeStrong/ts-node/pull/1585 Since Dec 29, 2021.
ts-nodedoes't supporttsconfig.paths. PR is not merged yet.
Alternatives
Additional context
No response
Feel free to open a PR to demonstrate that the tests pass.
My main concerns are feature parity and size. swc is much bigger than esbuild: esbuild vs @swc/core
Once we know it works, tsx should detect if swc is installed and use it only if it's installed.
Locking thread to direct further dialogue in the form of PRs.
currently tsx can't be used if decorators are used. esbuild doesn't support decorators nor has it a type system. only solution is either tsc or swc. supporting both would be nice. since typescript/tsc is usually already installed.