I'm trying to set up my dev environment to support cloudflare KV. Running wrangler pages dev --kv MY_KV ./dist is very annoying since it doens't support and hmr updates. I've tried wrangler pages dev --kv MY_KV --proxy 3003 --port 3002 -- astro dev --port 3003 - this way it supports hmr but we lose access to the cf runtime. Is there any way to get the best of both worlds?
#How to run astro dev with wrangler dev correctly?
6 messages · Page 1 of 1 (latest)
spent a lot of time this week trying to figure this out, but didn't get anywhere. my solutions up until now have been to create fake "dev" services via library wrappers, etc. but this isn't possible for everything, and gets really tedious too
If you have mono-repo tooling with task managment, you could make a preview command to run wrangler pages dev dist. And make that task depend on build, so build will be run always before preview. Watch that on files / rerun, and you have close to hmr.. 1s for me
The best solution would be either if wrangler supports everything in proxy mode, or astro dev would add an output dir
hm i'm not using a monorepo currently and don't really want to migrate to one since the project itself is rather simple
maybe astro dev will get outDir sometime, and then you could use wrangler with --live-reload