Skip to content

Commit 704b585

Browse files
committed
another attempt
1 parent caf8573 commit 704b585

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/image/src/image-loaders.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ export const wsImageLoader: ImageLoader = (props) => {
3535
src = src.slice("/cgi/asset".length);
3636
}
3737

38+
// Route SVGs through /cgi/asset/ to avoid image optimization
39+
if (src.toLowerCase().endsWith(".svg")) {
40+
return `/cgi/asset/${encodePathFragment(src)}`;
41+
}
42+
3843
const resultUrl = new URL("/cgi/image/", NON_EXISTING_DOMAIN);
3944

4045
if (props.format !== "raw") {

0 commit comments

Comments
 (0)