Fix Vite and Tanstack Router configuration warnings (#2092)

This commit is contained in:
Ray
2025-07-18 08:37:38 +08:00
committed by GitHub
parent 25570a1ccf
commit 619806da8b
5 changed files with 51 additions and 11 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"create-fumadocs-app": minor
---
Fix Vite and Tanstack Router configuration warnings
@@ -9,26 +9,27 @@
},
"dependencies": {
"@fumadocs/mdx-remote": "workspace:*",
"@tanstack/react-router": "^1.127.8",
"@tanstack/react-router-devtools": "^1.127.8",
"@tanstack/react-start": "^1.127.8",
"@tanstack/react-router": "^1.128.0",
"@tanstack/react-router-devtools": "^1.128.0",
"@tanstack/react-start": "^1.128.1",
"fumadocs-core": "workspace:*",
"fumadocs-ui": "workspace:*",
"gray-matter": "^4.0.3",
"lucide-static": "^0.525.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"tailwind-merge": "^3.3.1",
"vite": "^7.0.4",
"vite": "^7.0.5",
"zod": "^4.0.5"
},
"devDependencies": {
"@tailwindcss/vite": "^4.1.11",
"@types/node": "^24.0.13",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@types/node": "^24.0.14",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@vitejs/plugin-react": "^4.6.0",
"tailwindcss": "^4.1.11",
"typescript": "^5.7.2",
"typescript": "^5.8.3",
"vite-tsconfig-paths": "^5.1.4"
}
}
@@ -0,0 +1,28 @@
import { Link } from '@tanstack/react-router';
import { HomeLayout } from 'fumadocs-ui/layouts/home';
export function NotFound() {
return (
<HomeLayout
nav={{
title: 'Tanstack Start',
}}
className="text-center py-32 justify-center"
>
<div className="flex flex-col items-center gap-4">
<h1 className="text-6xl font-bold text-fd-muted-foreground">404</h1>
<h2 className="text-2xl font-semibold">Page Not Found</h2>
<p className="text-fd-muted-foreground max-w-md">
The page you are looking for might have been removed, had its name changed,
or is temporarily unavailable.
</p>
<Link
to="/"
className="mt-4 px-4 py-2 rounded-lg bg-fd-primary text-fd-primary-foreground font-medium text-sm hover:opacity-90 transition-opacity"
>
Back to Home
</Link>
</div>
</HomeLayout>
);
}
@@ -1,11 +1,13 @@
import { createRouter as createTanStackRouter } from '@tanstack/react-router';
import { routeTree } from './routeTree.gen';
import { NotFound } from './components/NotFound';
export function createRouter() {
return createTanStackRouter({
routeTree,
defaultPreload: 'intent',
scrollRestoration: true,
defaultNotFoundComponent: NotFound,
});
}
@@ -2,6 +2,7 @@ import { tanstackStart } from '@tanstack/react-start/plugin/vite';
import { defineConfig } from 'vite';
import tsConfigPaths from 'vite-tsconfig-paths';
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
server: {
@@ -12,6 +13,9 @@ export default defineConfig({
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
tanstackStart(),
tanstackStart({
customViteReactPlugin: true,
}),
react(),
],
});