Skip to content

Serve HTML over HTTP in non-watch mode #3

Description

@scott

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions