Newbie question: Web development in Deno 2, and .ts to .js transpiling.
How do you web-develop in Deno 2?
I have html files, which load .js files, which are - manually - transpiled .ts files (via a custom script I wrote using esbuild).
What I want during development is: make changes to watched .ts files -> .ts are autotranspiled to .js -> page/server reloads.
What are people using to that end (other than Ctrl-C > up > enter)? Am I missing something obvious here?
4 Replies
I built my own dev server. Think Mini-Vite! Have a look:
https://jsr.io/@ndh/hot
JSR
@ndh/hot - JSR
@ndh/hot on JSR: HOT is Deno dev-server service When first started, Hot will launch your browser with the served URL. It then watches the /src/ folder for any changes. When a change is detected, the service will build and bundle and hot-refresh the browser.
The reason I built
Hot does not require any deno.json, nor any package.json, and no node-modules folder. Hot creates its own config file on first use, and that is its only requirement.
The goal was to create an environment for quick development of vanilla HTML, CSS, JavaScript applications that leverage the joy of coding with Typescript.
Hot
, is that I don't care for all the bloat that a tool like Vite adds to your project.Hot does not require any deno.json, nor any package.json, and no node-modules folder. Hot creates its own config file on first use, and that is its only requirement.
The goal was to create an environment for quick development of vanilla HTML, CSS, JavaScript applications that leverage the joy of coding with Typescript.
Maybe exactly what I'm looking for, as I'm trying to build simple stuff on vanilla web. I'll look into it (and get back to you if necessary)... Thanks!
When your ready, grab a copy and examine it. It is pretty straight forward, and perhaps you could make a custom copy for you're own use.