Skip to content

Commit 0192bce

Browse files
add brief documentation regarding the cloudflare image loader
1 parent c80e1eb commit 0192bce

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/cloudflare-build-and-deployment.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ The OpenNext skew protection requires the following environment variables to be
4646

4747
Additionally, when deploying, an extra `CF_WORKERS_SCRIPTS_API_TOKEN` environment variable needs to be set to an API token that has the `Workers Scripts:Read` permission available on the Worker's account.
4848

49+
### Image loader
50+
51+
When deployed on the Cloudflare network a custom image loader is required. We set such loader in the Next.js config file when the `OPEN_NEXT_CLOUDFLARE` environment variable is set (which indicates that we're building the application for the Cloudflare deployment).
52+
53+
The custom loader can be found at [`site/cloudflare/image-loader.ts`](../apps/site/cloudflare/image-loader.ts).
54+
55+
For more details on this see: https://developers.cloudflare.com/images/transform-images/integrate-with-frameworks/#global-loader
56+
4957
## Scripts
5058

5159
Preview and deployment of the website targeting the Cloudflare network is implemented via the following two commands:

0 commit comments

Comments
 (0)