Skip to content

Commit

Permalink
fix(image-loader): handle development mode local image loading
Browse files Browse the repository at this point in the history
  • Loading branch information
enapupe committed Jun 7, 2024
1 parent fdb64aa commit 8d657ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/image-loader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use client'
const dev = process.env.NODE_ENV !== 'production'
const imageLoader = ({ src, width, quality }) => {
if (dev && src.startsWith('/_next')){
return `${src}?w=${width}&q=${quality || 75}`
}
return `${process.env.NEXT_PUBLIC_CDN_URL}${src}?w=${width}&q=${quality || 75}`
}

Expand Down

0 comments on commit 8d657ec

Please sign in to comment.