Replace the file:// URL with a localhost HTTP server even when --watch is not set. Benefits:
fetch()/XHR from the rendered page works (currently blocked by file:// origin null)
- Consistent behavior between watch and non-watch modes
- Easier to share a preview on the LAN
Tradeoffs:
- Process must stay running (breaks the current fire-and-forget UX in main)
- Need to pick a port (default to OS-assigned)
- Need cleanup on exit
Tracked from the live-reload implementation PR.
Replace the
file://URL with a localhost HTTP server even when--watchis not set. Benefits:fetch()/XHR from the rendered page works (currently blocked byfile://origin null)Tradeoffs:
Tracked from the live-reload implementation PR.