Skip to content

Commit

Permalink
use squoosh instead of sharp
Browse files Browse the repository at this point in the history
Avoids having to install sharp in every site package
  • Loading branch information
bates64 committed Jun 26, 2024
1 parent 7b0fb36 commit efc1c11
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 306 deletions.
4 changes: 4 additions & 0 deletions packages/astro-theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import rehypeSlug from "rehype-slug";
import rehypeExternalLinks from "rehype-external-links";
import { type AstroIntegration } from "astro";
import { addIntegration } from "astro-integration-kit";
import { squooshImageService } from "astro/config";

const prod = process.env.NODE_ENV === "production";

Expand Down Expand Up @@ -136,6 +137,9 @@ export default function ThemeIntegration(
inlineStylesheets: "always",
},
trailingSlash: "never",
image: {
service: squooshImageService(),
},
});
},
},
Expand Down
3 changes: 1 addition & 2 deletions packages/astro-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
"rehype-autolink-headings": "^7.0.0",
"rehype-external-links": "^3.0.0",
"rehype-slug": "^6.0.0",
"remark-obsidian-callout": "^1.1.3",
"sharp": "^0.32.6"
"remark-obsidian-callout": "^1.1.3"
},
"devDependencies": {
"sirv": "^2.0.4"
Expand Down
Loading

0 comments on commit efc1c11

Please sign in to comment.