Prevent timeout when loading routes in development (#25749)
Prevent timeout when loading routes in development (#25749)

* Prevent timeout when loading routes in development

The new route loader (https://github.com/vercel/next.js/pull/19006) will timeout
loading routes after 3.8s (MS_MAX_IDLE_DELAY), but this can easily happen when
running dev on a large app.

Fixes https://github.com/vercel/next.js/issues/25675

* Delay route loading timeout in development

* refactor: Integrate onBuildCallback into resolvePromiseWithTimeout

* refactor: Tweak for better dead-code elimination

Co-authored-by: JJ Kasper <7323a5431d1c31072983a6a5bf23745b655ddf59@jjsweb.site>
zeit/next.js,azukaru/next.js,JeromeFitz/next.js,flybayer/next.js,azukaru/next.js,flybayer/next.js,JeromeFitz/next.js,JeromeFitz/next.js,JeromeFitz/next.js,azukaru/next.js,zeit/next.js,flybayer/next.js,flybayer/next.js,zeit/next.js,azukaru/next.js