🐈
Astro 4.0から5.0への変更点
Astro 4.0から5.0への変更点のうち、
特に大きいものを取り上げます
<ViewTransitions />が<ClientRouter />に名前変更
- import { ViewTransitions } from 'astro:transitions';
+ import { ClientRouter } from 'astro:transitions';
<html>
<head>
...
- <ViewTransitions />
+ <ClientRouter />
</head>
</html>
tsconfig.jsonの更新
{
"extends": "astro/tsconfigs/base",
+ "include": [".astro/types.d.ts", "**/*"],
+ "exclude": ["dist"]
}
非推奨:Astro.glob
---
- const posts = await Astro.glob('./posts/*.md');
+ const posts = Object.values(import.meta.glob('./posts/*.md', { eager: true }));
---
{posts.map((post) => <li><a href={post.url}>{post.frontmatter.title}</a></li>)}
Discussion