Re:Starting a TypeScript Project in 2021
by lovelettr on Wednesday April 21, 2021 @11:57AM
(#26891349)
> but there was no way to bundle them together into one JS file you could include in your HTML and webpack takes a bit to setup
Maybe I am misunderstanding but this feels like it is provided via the `--bundle` flag in esbuild [1].
> It looks like esbuild doesn’t have websocket auto-reload magic so will need to refresh the web browser to see the recompiled changes.
I have also noticed that it does not seem to have the auto-reload part [2]. It does however have a server so that is at least something (e.g., `--servedir=dist`). Though that seems like a very new development.
[1] https://esbuild.github.io/getting-started/#your-first-bundle [2] https://github.com/evanw/esbuild/issues/802
Re:Starting a TypeScript Project in 2021
by tppiotrowski on Wednesday April 21, 2021 @01:38PM
(#26892878)
Thanks. I meant that `tsc` has no `--bundle` flag
Re:Starting a TypeScript Project in 2021
by WorldMaker on Wednesday April 21, 2021 @04:32PM
(#26895068)
Snowpack is an option if you want a fancier auto-reload dev server oriented around ES Modules. It can use either esbuild or webpack under the covers, IIRC, for its bundling step when it comes time for that.
Re:Starting a TypeScript Project in 2021
by vergessenmir on Wednesday April 21, 2021 @11:27AM
(#26890929)
I have started looking at this for Svelte projects from a post yesterday on non-javascript build tools. Very promising indeed,
It looks like esbuild doesn’t have websocket auto-reload magic so will need to refresh the web browser to see the recompiled changes.