rsnext/packages/next/next-server/server
JJ Kasper d130f63c41
Add handling fo beforeFiles, afterFiles, and fallback rewrites (#23407)
This adds support for returning an object from `rewrites` in `next.config.js` with `beforeFiles`, `afterFiles`, and `fallback` to allow specifying rewrites at different stages of routing. The existing support for returning an array for rewrites is still supported and behaves the same way. The documentation has been updated to include information on these new stages that can be rewritten and removes the outdated note of rewrites not being able to override pages. 



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-03-26 15:19:48 +00:00
..
lib Improve image optimizer to only create 1 worker thread (#23188) 2021-03-18 15:51:36 +00:00
api-utils.ts Add has route field (#22341) 2021-03-24 16:50:16 +00:00
config-shared.ts Add handling fo beforeFiles, afterFiles, and fallback rewrites (#23407) 2021-03-26 15:19:48 +00:00
config-utils.ts feat: automatically enable webpack 5 (#22323) 2021-03-24 14:10:10 +01:00
config.ts Ensure env is loaded before next config (#22879) 2021-03-08 16:53:52 +00:00
crypto-utils.ts chore(next-server): api-utils,crypto-utils,next-server missing types (#13431) 2020-05-27 15:43:10 +00:00
denormalize-page-path.ts Add initial handling for dynamic route href resolving and rewrites on the client (#15231) 2020-08-13 14:39:36 +02:00
font-utils.ts Font optimizations (#14746) 2020-07-28 12:19:28 +02:00
get-page-files.ts Modify low priority files in manifest (#16181) 2020-08-14 04:30:25 +00:00
get-route-from-entrypoint.ts Delay server compilation until client compilation is done in development (#22187) 2021-02-19 11:10:19 +01:00
image-config.ts Fallback to default config to enable testing Image component (#19107) 2020-11-12 19:24:08 +00:00
image-optimizer.ts Make sure the image optimization endpoint only response with images (#23366) 2021-03-24 17:59:00 +00:00
incremental-cache.ts Ensure prerender-manifest contains all i18n revalidate values (#21404) 2021-01-27 11:24:00 +00:00
load-components.ts Ensure component load order (#22731) 2021-03-03 19:20:48 +00:00
next-server.ts Add handling fo beforeFiles, afterFiles, and fallback rewrites (#23407) 2021-03-26 15:19:48 +00:00
node-polyfill-fetch.js ncc 0.25.0 upgrade and fixes (#18873) 2020-11-06 02:33:14 +00:00
normalize-page-path.ts Add initial handling for dynamic route href resolving and rewrites on the client (#15231) 2020-08-13 14:39:36 +02:00
optimize-amp.ts Add nccing AMP optimizer (#21980) 2021-02-11 09:55:56 +00:00
render.tsx Add generating static 500 status page (#22139) 2021-02-22 16:29:50 +00:00
require.ts Remove tslint disables (#16116) 2020-08-12 14:39:07 +00:00
router.ts Add handling fo beforeFiles, afterFiles, and fallback rewrites (#23407) 2021-03-26 15:19:48 +00:00
send-payload.ts Enable handling for revalidate and notFound (#19165) 2020-11-14 07:12:47 +00:00
serve-static.ts Add support for Image Optimizer (#17749) 2020-10-16 13:10:01 +02:00
utils.ts Improve Server Lib Utilities (#12119) 2020-04-23 09:38:57 +02:00