Skip to content

Commit

Permalink
feat: add assets with uppercase extension support
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelgautier committed Sep 18, 2024
1 parent 4be19d6 commit 0f181a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Picture.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ const {
...props
} = Astro.props;
const images = import.meta.glob<{ default: ImageMetadata }>(
"/src/assets/**/*.{webp,jpeg,jpg,png,svg,gif,avif}"
"/src/assets/**/*.{webp,WEBP,jpeg,JPEG,jpg,JPG,png,PNG,svg,SVG,gif,GIF,avif,AVIF}"
);
const srcPath = join(prefix, src.replace(/^\/assets\//, ''));
if (!images[srcPath]) {
throw new Error(
`"${srcPath}" does not exist in glob: "src/assets/**/*.{webp,jpeg,jpg,png,svg,gif,avif}"`
`"${srcPath}" does not exist in glob: "src/assets/**/*.{webp,WEBP,jpeg,JPEG,jpg,JPG,png,PNG,svg,SVG,gif,GIF,avif,AVIF}"`
);
}
---
Expand Down

0 comments on commit 0f181a0

Please sign in to comment.