Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
astro@5.12.0 source code.tar.gz | 2025-07-17 | 42.8 MB | |
astro@5.12.0 source code.zip | 2025-07-17 | 45.6 MB | |
README.md | 2025-07-17 | 3.5 kB | |
Totals: 3 Items | 88.5 MB | 0 |
Minor Changes
-
#13971
fe35ee2
Thanks @adamhl8! - Adds an experimental flagrawEnvValues
to disable coercion ofimport.meta.env
values (e.g. converting strings to other data types) that are populated fromprocess.env
Astro allows you to configure a type-safe schema for your environment variables, and converts variables imported via
astro:env
into the expected type.However, Astro also converts your environment variables used through
import.meta.env
in some cases, and this can prevent access to some values such as the strings"true"
(which is converted to a boolean value), and"1"
(which is converted to a number).The
experimental.rawEnvValues
flag disables coercion ofimport.meta.env
values that are populated fromprocess.env
, allowing you to use the raw value.To enable this feature, add the experimental flag in your Astro config:
```diff import { defineConfig } from "astro/config"
export default defineConfig({ + experimental: { + rawEnvValues: true, + } }) ```
If you were relying on this coercion, you may need to update your project code to apply it manually:
ts diff - const enabled: boolean = import.meta.env.ENABLED + const enabled: boolean = import.meta.env.ENABLED === "true"
See the experimental raw environment variables reference docs for more information.
-
#13941
6bd5f75
Thanks @aditsachde! - Adds support for TOML files to Astro's built-inglob()
andfile()
content loaders.In Astro 5.2, Astro added support for using TOML frontmatter in Markdown files instead of YAML. However, if you wanted to use TOML files as local content collection entries themselves, you needed to write your own loader.
Astro 5.12 now directly supports loading data from TOML files in content collections in both the
glob()
and thefile()
loaders.If you had added your own TOML content parser for the
file()
loader, you can now remove it as this functionality is now included:diff // src/content.config.ts import { defineCollection } from "astro:content"; import { file } from "astro/loaders"; - import { parse as parseToml } from "toml"; const dogs = defineCollection({ - loader: file("src/data/dogs.toml", { parser: (text) => parseToml(text) }), + loader: file("src/data/dogs.toml") schema: /* ... */ })
Note that TOML does not support top-level arrays. Instead, the
file()
loader considers each top-level table to be an independent entry. The table header is populated in theid
field of the entry object.See Astro's content collections guide for more information on using the built-in content loaders.
Patch Changes
- Updated dependencies [
6bd5f75
]:- @astrojs/markdown-remark@6.3.3