Skip to content

Commit b8c9914

Browse files
committed
feat: remove CF optimize
1 parent 3e7326c commit b8c9914

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/lib/optimizeImage.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
export default function optimizeImage(url: string, width?: number) {
2-
if (url.includes('imagedelivery.net')) {
3-
return optimizeImageForCloudflare(url, width);
4-
}
52
if (
63
!url.includes('https://images.velog.io') &&
74
!url.includes('https://media.vlpt.us')
@@ -19,13 +16,3 @@ export default function optimizeImage(url: string, width?: number) {
1916
}
2017
return replaced.concat(`?w=${width}`);
2118
}
22-
23-
export function optimizeImageForCloudflare(url: string, width?: number) {
24-
if (!width) return url;
25-
const replacer = (variant: string) => url.replace('public', variant);
26-
if (width === 640) return replacer('w640');
27-
if (width === 768) return replacer('w768');
28-
if (width === 240) return replacer('512x512');
29-
if (width === 120) return replacer('256x256');
30-
return url;
31-
}

0 commit comments

Comments
 (0)