3 ms·
Plain esbuild is perfect for adding typescript support to node.js projects. We literally just run ’esbuild && node dist/run.js’
by nicoburns 5y ago
Plain esbuild is perfect for adding typescript support to node.js projects. We literally just run ’esbuild && node dist/run.js’
- smt88 5y agoHow is this different from `tsc && node dist/run.js`?
- joshuacc 5y ago1. It’s much faster. 2. It won’t catch type errors. Regarding #2, I assume that things are set up so that type errors are caught in some other way, such as in CI or in a precommit hook.
- christophilus 5y agoWhat I do is run esbuild and tsc (with no emit) in parallel in watch mode. That way, I get fast rebuilds and iterations, but still eventually see the errors spit out. My code editor catches 90% of the errors, but it’s definitely nice to have tsc catch the rest earlier than the CI process.
- tomnipotent 5y ago> My code editor catches 90% of the errors With or without strict mode enabled?
- nicoburns 5y agoIt's a lot faster (runs in 0.1 seconds) so it doesn't affect our iteration speed at all.
- ComputerGuru 5y agoWhat about web projects, though? Isn’t that what the discussion is about (script tags and all)? Node projects aren’t too bad because you don’t need anything beyond local fs module resolution.