File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -27,16 +27,15 @@ const normalizeSrc = (src: string) => {
2727};
2828
2929export default function cloudflareLoader({ src , width , quality }: ImageLoaderProps ) {
30- if (process .env .NODE_ENV === " development" ) {
31- // Serve the original image when using `next dev`
32- return src ;
33- }
3430 const params = [` width=${width } ` ];
3531 if (quality ) {
3632 params .push (` quality=${quality } ` );
3733 }
38- const paramsString = params .join (" ," );
39- return ` /cdn-cgi/image/${paramsString }/${normalizeSrc (src )} ` ;
34+ if (process .env .NODE_ENV === " development" ) {
35+ // Serve the original image when using `next dev`
36+ return ` ${src }?${params .join (" &" )} ` ;
37+ }
38+ return ` /cdn-cgi/image/${params .join (" ," )}/${normalizeSrc (src )} ` ;
4039}
4140```
4241
You can’t perform that action at this time.
0 commit comments