Skip to content

Commit

Permalink
adding image chooser for cf pages 5
Browse files Browse the repository at this point in the history
  • Loading branch information
CKraft11 committed Sep 4, 2024
1 parent ed245eb commit a99846e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions functions/content/images/_middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import assetNegotiationPlugin from "pages-plugin-asset-negotiation";

export const onRequest: PagesFunction = assetNegotiationPlugin({
formats: ['webp'], // The formats you want to support, in order of preference. This is the default configuration and will serve a jxl image if the browser supports it (and it was found) first, followed by avif and then webp.
});

0 comments on commit a99846e

Please sign in to comment.