mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Current metadata files are compiled to `route.js` files. This happens not only to metadata API (e.g., `icon.tsx`), but to static files as well, which is unnecessary. In development, this leads to confusing logs such as: ``` Compiled /favicon.ico in ...ms ``` Users may reasonably wonder why Next.js is "compiling" a static file. Static files can be served directly from the filesystem, like `_next/static/` assets. Therefore, in development, skip compilation of static metadata files and serve them as static. For production, we can follow up in a separate PR to skip compiling the `route.js` files and emit static files to the dist directory, and also serve from the filesystem there as well. Closes [NEXT-4338](https://linear.app/vercel/issue/NEXT-4338) --- TODO(s) to follow up: - Fix Cache Components failing build with metadata files inside the dynamic route. - x-ref: [slack thread](https://vercel.slack.com/archives/C06N3AXRQ82/p1738053808940719) --------- Co-authored-by: Jiachi Liu <[email protected]>
13 lines
268 B
TypeScript
13 lines
268 B
TypeScript
import type { MetadataRoute } from 'next'
|
|
|
|
export default function sitemap(): MetadataRoute.Sitemap {
|
|
return [
|
|
{
|
|
url: 'https://nextjs.org',
|
|
lastModified: '2025-01-01T00:00:00.000Z',
|
|
changeFrequency: 'monthly',
|
|
priority: 0.8,
|
|
},
|
|
]
|
|
}
|