astro/.changeset/lucky-mirrors-type.md
Tony Sullivan 00c605ce35
Image integration refactor and cleanup (#4482)
* WIP: simplifying the use of `fs` vs. the vite plugin

* removing a few node deps (etag and node:path)

* adding ts defs for sharp

* using the same mime package as astro's core App

* fixing file URL support in windows

* using file URLs when loading local image metadata

* fixing a bug in the etag helper

* Windows compat

* splitting out dev & build tests

* why do these suites fail in parallel?

* one last windows compat case

* Adding tests for treating /public images the same as remote URLs

* a couple fixes for Astro's `base` config

* adding base path tests for SSR

* fixing a bad merge, lost the kleur dependency

* adding a test suite for images + MDX

* chore: add changeset

* simplifying the with-mdx tests

* bugfix: don't duplicate the period when using existing file extensions

* let Vite cache the image loader service

* adding some docs for using /public images

* fixing changeset

* Update packages/integrations/image/README.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update packages/integrations/image/README.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* nit: minor README syntax tweaks

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-30 21:09:44 +00:00

648 B

@astrojs/image
minor

<Image /> and <Picture /> now support using images in the /public directory 🎉

  • Moving handling of local image files into the Vite plugin
  • Optimized image files are now built to /dist with hashes provided by Vite, removing the need for a /dist/_image directory
  • Removes three npm dependencies: etag, slash, and tiny-glob
  • Replaces mrmime with the mime package already used by Astro's SSR server
  • Simplifies the injected _image route to work for both dev and build
  • Adds a new test suite for using images with @astrojs/mdx - including optimizing images straight from /public