N Next.js 中文
原文 ↗

typedRoutes

启用对静态类型链接的支持。

更新于 2025-08-19Next.js 16.4.6

注意:

此选项已被标记为稳定,因此你应使用 typedRoutes 而不是 experimental.typedRoutes。

支持静态类型链接。此功能需要在项目中使用 TypeScript。

next.config.jsjs
/** @type {import('next').NextConfig} */
const nextConfig = {
  typedRoutes: true,
}

module.exports = nextConfig