Hi!
When using the cloudflare-workers+vite template, I can augment the preview with the --live-reload script to get hot reloading of my changes:
"scripts": {
"dev": "vite",
"preview": "wrangler dev --live-reload",
"deploy": "wrangler deploy"
},
When trying the same on the x-basic template, changes to my code are not hot-reloaded. I have to manually run the build script to get the new changes.
When I add a build section to my wrangler.jsonc:
"build": {
"watch_dir": "./app",
"command": "bun run build"
},
...the build script always runs twice*, leading to very long reload times.
What is the recommended configuration to get performant hot-reloading?
Thanks!
*I know that the honox build script calls vite twice (vite build --mode client && vite build), so configuring the build section as described above calls vite 4 times on changes.
Hi!
When using the
cloudflare-workers+vitetemplate, I can augment thepreviewwith the--live-reloadscript to get hot reloading of my changes:When trying the same on the
x-basictemplate, changes to my code are not hot-reloaded. I have to manually run thebuildscript to get the new changes.When I add a
buildsection to mywrangler.jsonc:...the build script always runs twice*, leading to very long reload times.
What is the recommended configuration to get performant hot-reloading?
Thanks!
*I know that the honox build script calls
vitetwice (vite build --mode client && vite build), so configuring thebuildsection as described above callsvite4 times on changes.