Next.js 9 开始有 内建的 TypeScript 支持。
开始使用:
.js
.tsx
npm run dev
tsconfig.json
Next.js 会在开发(npm run dev)和生产(npm build)时都做 TS 的编译期检查。
npm build