Skip to content

Commit

Permalink
fix(astro): use sharp for images
Browse files Browse the repository at this point in the history
Squoosh not working on Node 18

fix #6
  • Loading branch information
craftzdog committed Nov 14, 2022
1 parent ce1b6b6 commit 628ce7e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
9 changes: 8 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ import addClasses from 'rehype-add-classes'
// https://astro.build/config
export default defineConfig({
site: 'https://uses.craftz.dog/',
integrations: [sitemap(), react(), image(), tailwind()],
integrations: [
sitemap(),
react(),
image({
serviceEntryPoint: '@astrojs/image/sharp'
}),
tailwind()
],
markdown: {
extendDefaultPlugins: true,
rehypePlugins: [
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"astro": "^1.2.3",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-icons": "^4.4.0"
"react-icons": "^4.4.0",
"sharp": "^0.31.2"
},
"devDependencies": {
"@inkdropapp/live-export": "^0.1.8",
Expand Down
21 changes: 21 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3848,6 +3848,13 @@ semver@^7.3.5, semver@^7.3.7:
dependencies:
lru-cache "^6.0.0"

semver@^7.3.8:
version "7.3.8"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"
integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==
dependencies:
lru-cache "^6.0.0"

sharp@^0.30.6:
version "0.30.7"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.30.7.tgz#7862bda98804fdd1f0d5659c85e3324b90d94c7c"
Expand All @@ -3862,6 +3869,20 @@ sharp@^0.30.6:
tar-fs "^2.1.1"
tunnel-agent "^0.6.0"

sharp@^0.31.2:
version "0.31.2"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.31.2.tgz#a8411c80512027f5a452b76d599268760c4e5dfa"
integrity sha512-DUdNVEXgS5A97cTagSLIIp8dUZ/lZtk78iNVZgHdHbx1qnQR7JAHY0BnXnwwH39Iw+VKhO08CTYhIg0p98vQ5Q==
dependencies:
color "^4.2.3"
detect-libc "^2.0.1"
node-addon-api "^5.0.0"
prebuild-install "^7.1.1"
semver "^7.3.8"
simple-get "^4.0.1"
tar-fs "^2.1.1"
tunnel-agent "^0.6.0"

shebang-command@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
Expand Down

0 comments on commit 628ce7e

Please sign in to comment.