Next.js Discord

Discord Forum

Please what's wrong with this image Loader file

Unanswered
Ichneumonid wasp posted this in #help-forum
Open in Discord
Ichneumonid waspOP
export default function sanityImageLoader({
src,
width,
quality,
}: {
src: string
width: number
quality?: number
}) {
const params = ['f_auto', 'climit', `w${width},q_${quality || 'auto'}] returnhttps://cdn.sanity.io/images/${
process.env.NEXT_PUBLIC_SANITY_PROJECT_ID
}/production/${src}?${params.join(",")}`;
}

0 Replies