vite site + pages local-dev
I am trying to run vite react site with worker, with local live-reloading dev-server. I set this up:
So vite runs a local dev-server, then
wrangler pages dev
proxies pages to it. I hit the wrangler address http://127.0.0.1:8788
and I get an error about no --directory
set. I set --directory
to public (the static-asset dir for vite) and it 404s on index, but serves other files there. Should I proxy the other way? (hit vite, and proxy for backend to wrangler) Is there a better way to do this?6 Replies
helloo - im having a similar problem. Did you ever figure this out?
the command im running is
wrangler pages dev -- vite ./pages --port 8081
BUT pages functions seem to not work in this scenarionope, I ended up just working on the front/backend seperately.
btw i think i got this setup working recently
i wish there was just a template command that just init'd all this stuff in a snap
hi, what setup did you do for this one?
Ahh sorry, I don't remember at this point, I changed direction lol. Let me see if I can dig it up from an old project. It was too painful to run this while needing to expand and tweak the config for the life of the project.
I also don't think my project was well suited for this.
Ah I appreciate it. If you could find the config, it would be great. If you cannot, it is okay.
From my understandings, it looks like the --live-reload only live reloads the backend/functions not the frontend 😦 since they using the asset from the dist directory.