✨ Major Changes
-
#12268
4e9a3acThanks @ematipico! - The commandastro add vercelnow updates the configuration file differently, and adds@astrojs/vercelas module to import.This is a breaking change because it requires the version
8.*of@astrojs/vercel. -
#12231
90ae100Thanks @bluwy! - Updates the automaticcharset=utf-8behavior for Markdown pages, where instead of responding withcharset=utf-8in theContent-Typeheader, Astro will now automatically add the<meta charset="utf-8">tag instead.This behaviour only applies to Markdown pages (
.mdor similar Markdown files located withinsrc/pages/) that do not use Astro’s speciallayoutfrontmatter property. It matches the rendering behaviour of other non-content pages, and retains the minimal boilerplate needed to write with non-ASCII characters when adding individual Markdown pages to your site.If your Markdown pages use the
layoutfrontmatter property, then HTML encoding will be handled by the designated layout component instead, and the<meta charset="utf-8">tag will not be added to your page by default.If you require
charset=utf-8to render your page correctly, make sure that your layout components contain the<meta charset="utf-8">tag. You may need to add this if you have not already done so.
🍿 Minor Changes
-
#12243
eb41d13Thanks @florian-lefebvre! - ImprovesdefineConfigtype safety. TypeScript will now error if a group of related configuration options do not have consistent types. For example, you will now see an error if your language set fori18n.defaultLocaleis not one of the supported locales specified ini18n.locales. -
#12150
93351bcThanks @bluwy! - Adds support for passing values other than"production"or"development"to the--modeflag (e.g."staging","testing", or any custom value) to change the value ofimport.meta.env.MODEor the loaded.envfile. This allows you take advantage of Vite’s mode feature.Also adds a new
--devOutputflag forastro buildthat will output a development-based build.Note that changing the
modedoes not change the kind of code transform handled by Vite and Astro:- In
astro dev, Astro will transform code with debug information. - In
astro build, Astro will transform code with the most optimized output and removes debug information. - In
astro build --devOutput(new flag), Astro will transform code with debug information like inastro dev.
This enables various usecases like:
Terminal window # Run the dev server connected to a "staging" APIastro dev --mode staging# Build a site that connects to a "staging" APIastro build --mode staging# Build a site that connects to a "production" API with additional debug informationastro build --devOutput# Build a site that connects to a "testing" APIastro build --mode testingThe different modes can be used to load different
.envfiles, e.g..env.stagingor.env.production, which can be customized for each environment, for example with differentAPI_URLenvironment variable values. - In
🐞 Patch Changes
-
#12302
7196c24Thanks @ematipico! - Fixes an issue where the origin check middleware run for prendered pages -
#12341
c1786d6Thanks @ematipico! - Fixes and issue whereAstro.currentLocalealways returned the default locale when consumed inside a server island. -
#12270
25192a0Thanks @ematipico! - Fixes a bug where the params weren’t correctly computed when rendering URLs with non-English characters