astro 2.2.0
Minor Changes
-
#6703
a1108e037Thanks @Princesseuh! - Moveimage()to come fromschemainstead to fix it not working with refine and inside complex typesMigration:
Remove the
imageimport fromastro:content, and instead use a function to generate your schema, like such:import { defineCollection, z } from 'astro:content'; defineCollection({ schema: ({ image }) => z.object({ image: image().refine((img) => img.width >= 200, { message: 'image too small', }), }), }); -
#6714
ff0430786Thanks @bluwy! - Addbuild.assetsPrefixoption for CDN support. If set, all Astro-generated asset links will be prefixed with it. For example, setting it tohttps://cdn.example.comwould generatehttps://cdn.example.com/_astro/penguin.123456.pnglinks.Also adds
import.meta.env.ASSETS_PREFIXenvironment variable that can be used to manually create asset links not handled by Astro.
Patch Changes
-
#6753
489dd8d69Thanks @bluwy! - FixgetViteConfigreturn type -
#6744
a1a4f45b5Thanks @Princesseuh! - Fix remote images in Markdown throwing errors when usingexperimental.assets -
#6762
8b88e4cf1Thanks @Princesseuh! - Improved error message when an error was encountered while generating types -
#6719
d54cbe413Thanks @matthewp! - Better errors for when response is already sentThis adds clearer error messaging when a Response has already been sent to the browser and the developer attempts to use:
- Astro.cookies.set
- Astro.redirect
-
#6741
4c347ab51Thanks @Princesseuh! - Fix content-type header being wrong in dev on images fromastro:assets -
#6739
2f2e572e9Thanks @Princesseuh! - Added more types and utilities exports related toastro:assetsto help building custom image components and image services -
Updated dependencies [
a1a4f45b5]:- @astrojs/markdown-remark@2.1.3