跳到主要內容

typedRoutes

此功能目前為實驗性質,可能會變更,不建議用於生產環境。請試用並在 GitHub 上分享您的意見回饋。

實驗性支援 靜態類型連結。此功能需要使用 App Router 以及專案中的 TypeScript。

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