Repository navigation
Commit 699ede4
fix(@angular/build): pass an explicit port of 0 through to the dev server
Previously, requesting an ephemeral port (`--port 0`) was resolved by
binding a throwaway net.Server to learn the real port before handing
that concrete number to Vite or webpack-dev-server, which then bound
it again. This avoided a Vite bug where `server.port: 0` was ignored
and the default port (5173) was used instead.
That bug is fixed upstream (vitejs/vite#7529, vitejs/vite#23158), and
webpack-dev-server has always bound port 0 correctly via Node's own
http.Server. Pass 0 straight through instead of pre-resolving it,
removing the redundant double-bind.
Verified via the existing port_spec.ts "random free port" test for
both the Vite-based and webpack-based dev server, which covers this
exact scenario.
(cherry picked from commit 3123cf2)1 parent c2ae475 commit 699ede4
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments