NNext.js 中文网 GitHub

typedRoutes

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

注意:此选项已标记为稳定版,因此你应使用 typedRoutes 而非 experimental.typedRoutes。

支持静态类型链接。此功能要求你的项目使用 TypeScript。

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

module.exports = nextConfig