Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add options to cloudflare-adapter to allow custom _routes rules #9111

Merged
merged 17 commits into from
Feb 28, 2023
Merged
Prev Previous commit
Next Next commit
tweak inline documentation
  • Loading branch information
Rich-Harris committed Feb 28, 2023
commit 2247b7a88077b8a44fe0b322e7b460520524855f
20 changes: 10 additions & 10 deletions packages/adapter-cloudflare/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ export default function plugin(options?: AdapterOptions): Adapter;

export interface AdapterOptions {
/**
* Customize the automatically-generated _routes.json file.
* Customize the automatically-generated `_routes.json` file
* https://developers.cloudflare.com/pages/platform/functions/routing/#create-a-_routesjson-file
*/
routes?: {
/**
* Routes that will be invoked by Functions. Accepts wildcard behavior.
*
* Routes that will be invoked by functions. Accepts wildcards.
* @default ["/*"]
*/
include?: string[];

/**
* Defines routes that will not be invoked by Functions. Accepts wildcard behavior.
* Exclude always take priority over include.
* Routes that will not be invoked by functions. Accepts wildcards.
* `exclude` takes priority over `include`.
*
* To have the adapter automatically exclude certain things, you can use these placeholders:<br/>
* To have the adapter automatically exclude certain things, you can use these placeholders:
*
* - \<build> to exclude the appDir (default is _app)
* - \<files> for static files
* - \<prerendered> for prerendered pages/paths
* - \<all> to exclude all of the above
* - `<build>` to exclude build artifacts (files generated by Vite)
* - `<files>` for the contents of your `static` directory
* - `<prerendered>` for prerendered routes
* - `<all>` to exclude all of the above
*
* @default ["<all>"]
*/
Expand Down