⚠️ Beta Software: This tool is under active development. It currently handles basic migrations but expect bugs and missing features.
A CLI tool to migrate Next.js projects to TanStack Start.
npx next-to-tanstack migrateOr use the short alias:
npx n2t migrateImportant: This modifies your project files. Commit your changes to git first!
- Swaps Next.js dependencies for TanStack Router and Start
- Converts
layout.tsx→__root.tsx - Converts
page.tsx→index.tsx - Creates
vite.config.tsand updates project config - Transforms Next.js code to TanStack equivalents
- Root layout and home page (basic projects)
- App Router projects (not Pages Router)
Coming soon:
- Support for additional pages and nested routes
- API routes transformation
- Dynamic routes
- Better error handling
After migration:
- Review all transformed files
- Test your application thoroughly
- Handle any API routes
- Configure deployment settings
- Adjust dynamic routes
- Node.js 18+
- Next.js project with App Router
- Git (to track changes)
Want to help? Check out CONTRIBUTING.md
This tool is still early and needs your feedback and contributions!
ISC