2023-02-19

週刊 Astro 14

@astrojs/[email protected]

@astrojs/[email protected] がリリースされました。@astrojs/image において SVG のサポートが追加されました:

Add support for SVG images to  `@astrojs/image` by ggounot · Pull Request #6118 · withastro/astro · GitHub
Add support for SVG images to  `@astrojs/image` by ggounot · Pull Request #6118 · withastro/astro · GitHub
This fixes issue #6101. Changes Add support for SVG images to @astrojs/image: add '*.svg' module declaration; add svg in InputFormat and OutputFormat; update SharpService.transform() and SquooshService.transform() to directly return the input image if the format is svg. This allows importing SVG files and displaying them through <Image />. Sharp and Squoosh cannot output SVG so no transformation is performed if the output format is SVG. The SVG's metadata can be read and used to generate the right attributes in the resulting <img />. Testing Added an SVG image in the basic-image fixture and tests for it in image-ssg.test.js, image-ssr-build.test.js and image-ssr-dev.test.js. Docs Added information on SVG format usage in @astrojs/image's README.md.
github.com

その他