9da99bcb66
Extracted from https://github.com/vercel/next.js/pull/13333, the same exact code lives in that PR as well, but we can merge this separately if it makes reviewing https://github.com/vercel/next.js/pull/13333 easier This PR does 3 things - deduplicate code from build and next-dev-server that loads custom routes from next.config.js (`loadCustomRoutes`) - in `loadCustomRoutes`, load these rewrites, headers and redirects configs concurrently instead of sequentially. - in next-server, make `this.customRoutes` always defined, this allows us to remove the big `if` around its initialization code in `generateRoutes`, which in turn makes it possible to reuse this code for other routing than user defined routes, which is how https://github.com/vercel/next.js/pull/13333 adds its redirects. |
||
---|---|---|
.. | ||
lib | ||
api-utils.ts | ||
config.ts | ||
crypto-utils.ts | ||
get-page-files.ts | ||
get-route-from-entrypoint.ts | ||
load-components.ts | ||
next-server.ts | ||
node-polyfill-fetch.js | ||
normalize-page-path.ts | ||
optimize-amp.ts | ||
render.tsx | ||
require.ts | ||
router.ts | ||
send-html.ts | ||
send-payload.ts | ||
serve-static.ts | ||
spr-cache.ts | ||
utils.ts |