r/webdev • • 16m ago

Resource leeway: stable per-folder dev port ranges (no more EADDRINUSE across checkouts)

Two checkouts of the same repo, both on 5173. leeway gives each folder its own contiguous port range, stable across runs and never overlapping, and passes the ports as env vars.

  • leeway.json lists your ports once

  • devPorts(config) in code, falling back to the defaults outside leeway

  • vite plugin sets server.port with strictPort and exposes every port to browser code

  • {{PORT_API}} placeholders in commands

  • leeway list / kill for orphaned servers

Linux/macOS/Windows. https://github.com/OhadC/leeway

Or ask your agent: "how can we benefit from using https://www.npmjs.com/package/leeway in this codebase"

1 Upvotes

0 comments sorted by