Legacy flags
このコンテンツはまだ日本語訳がありません。
To help some users migrate between versions of Astro, we occasionally introduce legacy flags.
These flags allow you to opt in to some deprecated or otherwise outdated behavior of Astro in the latest version, so that you can continue to upgrade and take advantage of new Astro releases until you are able to fully update your project code.
collectionsBackwardsCompat
Section titled “collectionsBackwardsCompat”astro@6.0.0
ベータ
The legacy.collectionsBackwardsCompat flag provides temporary backwards compatibility for projects unable to migrate to the Content Layer API introduced in v5.0.
export default defineConfig({ legacy: { collectionsBackwardsCompat: true, },});This flag preserves some legacy v4 content collections features:
- Supports
type: 'content'andtype: 'data'without loaders - Preserves legacy entry API:
entry.slugandentry.render() - Uses path-based entry IDs instead of slug-based IDs
This is a temporary migration helper. Migrate collections to the Content Layer API, then disable this flag.
Reference