Skip to content

Try tanstack start #3833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/.cache
/.nitro
/.output
/.tanstack
/coverage
/dist
/lib
Expand Down
3 changes: 3 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"includes": [
"**",
"!.cache/**/*",
"!.nitro/**/*",
"!.output/**/*",
"!.tanstack/**/*",
"!coverage/**/*",
"!dist/**/*",
"!lib/**/*",
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import testingLibrary from 'eslint-plugin-testing-library';
import markdown from '@eslint/markdown';

export default defineConfig([
globalIgnores(['.cache', 'coverage', 'dist', 'lib']),
globalIgnores(['.cache', '.nitro', '.output', '.tanstack', 'coverage', 'dist', 'lib']),

{
linterOptions: {
Expand Down
13 changes: 0 additions & 13 deletions index.html

This file was deleted.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
],
"scripts": {
"start": "vite serve --clearScreen false",
"preview": "vite preview",
"preview": "node .output/server/index.mjs",
"build:website": "vite build",
"build": "rolldown -c",
"test": "vitest run",
Expand All @@ -58,13 +58,14 @@
"@faker-js/faker": "^9.9.0",
"@ianvs/prettier-plugin-sort-imports": "^4.5.1",
"@linaria/core": "^6.3.0",
"@tanstack/react-router": "^1.128.0",
"@tanstack/router-plugin": "^1.128.0",
"@tanstack/react-router": "^1.130.12",
"@tanstack/react-start": "^1.130.15",
"@types/node": "^24.0.14",
"@types/react": "^19.1.3",
"@types/react-dom": "^19.1.3",
"@typescript-eslint/eslint-plugin": "^8.37.0",
"@typescript-eslint/parser": "^8.37.0",
"@vitejs/plugin-react": "^4.7.0",
"@vitejs/plugin-react-oxc": "^0.3.0",
"@vitest/browser": "^3.2.4",
"@vitest/coverage-v8": "^3.2.4",
Expand Down
20 changes: 13 additions & 7 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { tanstackRouter } from '@tanstack/router-plugin/vite';
import { tanstackStart } from '@tanstack/react-start/plugin/vite';
import react from '@vitejs/plugin-react-oxc';
import wyw from '@wyw-in-js/vite';
import { defineConfig } from 'vite';
Expand Down Expand Up @@ -56,12 +56,18 @@ export default defineConfig(({ command, isPreview }) => ({
},
plugins: [
(!isTest || isPreview) &&
tanstackRouter({
target: 'react',
generatedRouteTree: 'website/routeTree.gen.ts',
routesDirectory: 'website/routes',
autoCodeSplitting: true,
verboseFileRoutes: false
tanstackStart({
customViteReactPlugin: true,
tsr: {
srcDirectory: 'website',
// @ts-expect-error types are not correct
autoCodeSplitting: true,
verboseFileRoutes: false
},
prerender: {
enabled: true,
crawlLinks: true
}
}),
react({
exclude: ['./.cache/**/*']
Expand Down
7 changes: 2 additions & 5 deletions website/root.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ body {
}

body {
display: grid;
grid-template-columns: auto 1fr;
color-scheme: var(--rdg-color-scheme, light dark);
background-color: light-dark(#fff, hsl(0deg 0% 10%));
color: light-dark(#111, #fff);
}

#root {
display: grid;
grid-template-columns: auto 1fr;
}

.fill-grid {
block-size: 100%;
}
41 changes: 0 additions & 41 deletions website/root.tsx

This file was deleted.

Loading