Repository: TanStack/router
Pull request #3405 (2025-02-12 17:26:34)

examples: form payload should be a data object


Patch:
diff --git a/docs/router/framework/react/guide/file-based-routing.md b/docs/router/framework/react/guide/file-based-routing.md
index d47dac39c..88df0cfd3 100644
--- a/docs/router/framework/react/guide/file-based-routing.md
+++ b/docs/router/framework/react/guide/file-based-routing.md
@@ -424,9 +424,9 @@ The following options are available for configuration via the `tsr.config.json`
   - See the [using automatic code-splitting](./code-splitting.md#using-automatic-code-splitting) guide.
 
 - **`quoteStyle`**
-  - (Optional, **Defaults to `single`**) whether to use `single` or `double` quotes when formatting the generated route tree file.
+  - (Optional, **Defaults to `single`**) whether to use `single` or `double` quotes when formatting the generated files.
 - **`semicolons`**
-  - (Optional, **Defaults to `false`**) whether to use semicolons in the generated route tree file.
+  - (Optional, **Defaults to `false`**) whether to use semicolons in the generated files.
 - **`apiBase`**
   - (Optional) The base path for API routes. Defaults to `/api`.
   - This option is reserved for future use by the TanStack Start for API routes.
diff --git a/examples/react/authenticated-routes/package.json b/examples/react/authenticated-routes/package.json
index cf3494cfb..6201096c4 100644
--- a/examples/react/authenticated-routes/package.json
+++ b/examples/react/authenticated-routes/package.json
@@ -11,7 +11,7 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/basic-file-based-codesplitting/package.json b/examples/react/basic-file-based-codesplitting/package.json
index 6cfee06b9..85b062c4f 100644
--- a/examples/react/basic-file-based-codesplitting/package.json
+++ b/examples/react/basic-file-based-codesplitting/package.json
@@ -11,7 +11,7 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/basic-file-based/package.json b/examples/react/basic-file-based/package.json
index e79e380e3..c7d9eb7a0 100644
--- a/examples/react/basic-file-based/package.json
+++ b/examples/react/basic-file-based/package.json
@@ -11,7 +11,7 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/basic-react-query-file-based/package.json b/examples/react/basic-react-query-file-based/package.json
index 42f23c83e..575f6e757 100644
--- a/examples/react/basic-react-query-file-based/package.json
+++ b/examples/react/basic-react-query-file-based/package.json
@@ -13,7 +13,7 @@
     "@tanstack/react-query-devtools": "^5.66.0",
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/basic-ssr-file-based/package.json b/examples/react/basic-ssr-file-based/package.json
index e1749c6a9..e8964f6a8 100644
--- a/examples/react/basic-ssr-file-based/package.json
+++ b/examples/react/basic-ssr-file-based/package.json
@@ -13,8 +13,8 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
+    "@tanstack/start": "^1.102.6",
     "get-port": "^7.1.0",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
diff --git a/examples/react/basic-ssr-streaming-file-based/package.json b/examples/react/basic-ssr-streaming-file-based/package.json
index 2d11da6c0..aa2aa48dc 100644
--- a/examples/react/basic-ssr-streaming-file-based/package.json
+++ b/examples/react/basic-ssr-streaming-file-based/package.json
@@ -13,8 +13,8 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
+    "@tanstack/start": "^1.102.6",
     "get-port": "^7.1.0",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
diff --git a/examples/react/basic-virtual-file-based/package.json b/examples/react/basic-virtual-file-based/package.json
index 618d5e518..dfa3a5b95 100644
--- a/examples/react/basic-virtual-file-based/package.json
+++ b/examples/react/basic-virtual-file-based/package.json
@@ -11,7 +11,7 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "@tanstack/virtual-file-routes": "^1.99.0",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
diff --git a/examples/react/basic-virtual-inside-file-based/package.json b/examples/react/basic-virtual-inside-file-based/package.json
index 892e43f22..828f37675 100644
--- a/examples/react/basic-virtual-inside-file-based/package.json
+++ b/examples/react/basic-virtual-inside-file-based/package.json
@@ -11,7 +11,7 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "@tanstack/virtual-file-routes": "^1.99.0",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
diff --git a/examples/react/kitchen-sink-file-based/package.json b/examples/react/kitchen-sink-file-based/package.json
index dc4045155..baf3f0269 100644
--- a/examples/react/kitchen-sink-file-based/package.json
+++ b/examples/react/kitchen-sink-file-based/package.json
@@ -11,7 +11,7 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "immer": "^10.1.1",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
diff --git a/examples/react/kitchen-sink-react-query-file-based/package.json b/examples/react/kitchen-sink-react-query-file-based/package.json
index 9209489dd..570f7ef12 100644
--- a/examples/react/kitchen-sink-react-query-file-based/package.json
+++ b/examples/react/kitchen-sink-react-query-file-based/package.json
@@ -13,7 +13,7 @@
     "@tanstack/react-query-devtools": "^5.66.0",
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "immer": "^10.1.1",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
diff --git a/examples/react/large-file-based/package.json b/examples/react/large-file-based/package.json
index 317f03a69..ee34cbcf0 100644
--- a/examples/react/large-file-based/package.json
+++ b/examples/react/large-file-based/package.json
@@ -14,7 +14,7 @@
     "@tanstack/react-query": "^5.66.0",
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/quickstart-esbuild-file-based/package.json b/examples/react/quickstart-esbuild-file-based/package.json
index f15593c3b..40d354d99 100644
--- a/examples/react/quickstart-esbuild-file-based/package.json
+++ b/examples/react/quickstart-esbuild-file-based/package.json
@@ -11,7 +11,7 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/quickstart-file-based/package.json b/examples/react/quickstart-file-based/package.json
index b511e59a3..e2310805d 100644
--- a/examples/react/quickstart-file-based/package.json
+++ b/examples/react/quickstart-file-based/package.json
@@ -11,7 +11,7 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/quickstart-rspack-file-based/package.json b/examples/react/quickstart-rspack-file-based/package.json
index bc54a2efc..3fe83fa0a 100644
--- a/examples/react/quickstart-rspack-file-based/package.json
+++ b/examples/react/quickstart-rspack-file-based/package.json
@@ -19,7 +19,7 @@
   "devDependencies": {
     "@rsbuild/core": "1.2.4",
     "@rsbuild/plugin-react": "1.1.0",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "@types/react": "^19.0.8",
     "@types/react-dom": "^19.0.3",
     "typescript": "^5.6.2"
diff --git a/examples/react/quickstart-webpack-file-based/package.json b/examples/react/quickstart-webpack-file-based/package.json
index 0446f2168..bb4e35862 100644
--- a/examples/react/quickstart-webpack-file-based/package.json
+++ b/examples/react/quickstart-webpack-file-based/package.json
@@ -14,7 +14,7 @@
   },
   "devDependencies": {
     "@swc/core": "^1.10.15",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "@types/react": "^19.0.8",
     "@types/react-dom": "^19.0.3",
     "html-webpack-plugin": "^5.6.3",
diff --git a/examples/react/router-monorepo-react-query/package.json b/examples/react/router-monorepo-react-query/package.json
index b71796b27..eaaf15e52 100644
--- a/examples/react/router-monorepo-react-query/package.json
+++ b/examples/react/router-monorepo-react-query/package.json
@@ -14,7 +14,7 @@
     "@tanstack/react-query-devtools": "^5.66.0",
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1"
diff --git a/examples/react/router-monorepo-react-query/packages/router/package.json b/examples/react/router-monorepo-react-query/packages/router/package.json
index 550dfa5d8..3ad8b7a3b 100644
--- a/examples/react/router-monorepo-react-query/packages/router/package.json
+++ b/examples/react/router-monorepo-react-query/packages/router/package.json
@@ -11,7 +11,7 @@
     "@tanstack/history": "^1.99.13",
     "@tanstack/react-query": "^5.66.0",
     "@tanstack/react-router": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "@router-mono-react-query/post-query": "workspace:*",
     "redaxios": "^0.5.1",
     "zod": "^3.24.1",
diff --git a/examples/react/router-monorepo-simple-lazy/package.json b/examples/react/router-monorepo-simple-lazy/package.json
index ff3c5f1bd..5ec4d7f5b 100644
--- a/examples/react/router-monorepo-simple-lazy/package.json
+++ b/examples/react/router-monorepo-simple-lazy/package.json
@@ -10,7 +10,7 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1"
diff --git a/examples/react/router-monorepo-simple-lazy/packages/router/package.json b/examples/react/router-monorepo-simple-lazy/packages/router/package.json
index 797f1dfac..cdf730390 100644
--- a/examples/react/router-monorepo-simple-lazy/packages/router/package.json
+++ b/examples/react/router-monorepo-simple-lazy/packages/router/package.json
@@ -10,7 +10,7 @@
   "dependencies": {
     "@tanstack/history": "^1.99.13",
     "@tanstack/react-router": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "redaxios": "^0.5.1",
     "zod": "^3.24.1",
     "react": "^19.0.0",
diff --git a/examples/react/router-monorepo-simple/package.json b/examples/react/router-monorepo-simple/package.json
index 2b5deaa20..e964adf14 100644
--- a/examples/react/router-monorepo-simple/package.json
+++ b/examples/react/router-monorepo-simple/package.json
@@ -10,7 +10,7 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1"
diff --git a/examples/react/router-monorepo-simple/packages/router/package.json b/examples/react/router-monorepo-simple/packages/router/package.json
index 46ebdd802..4f7b9751e 100644
--- a/examples/react/router-monorepo-simple/packages/router/package.json
+++ b/examples/react/router-monorepo-simple/packages/router/package.json
@@ -10,7 +10,7 @@
   "dependencies": {
     "@tanstack/history": "^1.99.13",
     "@tanstack/react-router": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "redaxios": "^0.5.1",
     "zod": "^3.24.1",
     "react": "^19.0.0",
diff --git a/examples/react/search-validator-adapters/package.json b/examples/react/search-validator-adapters/package.json
index aec33d9f7..1d2035a8f 100644
--- a/examples/react/search-validator-adapters/package.json
+++ b/examples/react/search-validator-adapters/package.json
@@ -14,7 +14,7 @@
     "@tanstack/react-query": "^5.66.0",
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
     "@tanstack/valibot-adapter": "^1.102.5",
     "@tanstack/zod-adapter": "^1.102.5",
     "arktype": "^2.0.4",
diff --git a/examples/react/start-basic-auth/app/components/Login.tsx b/examples/react/start-basic-auth/app/components/Login.tsx
index 6e114612e..a3cb2ecdb 100644
--- a/examples/react/start-basic-auth/app/components/Login.tsx
+++ b/examples/react/start-basic-auth/app/components/Login.tsx
@@ -31,8 +31,10 @@ export function Login() {
         const formData = new FormData(e.target as HTMLFormElement)
 
         loginMutation.mutate({
-          email: formData.get('email') as string,
-          password: formData.get('password') as string,
+          data: {
+            email: formData.get('email') as string,
+            password: formData.get('password') as string,
+          },
         })
       }}
       afterSubmit={
@@ -49,8 +51,10 @@ export function Login() {
                     )
 
                     signupMutation.mutate({
-                      email: formData.get('email') as string,
-                      password: formData.get('password') as string,
+                      data: {
+                        email: formData.get('email') as string,
+                        password: formData.get('password') as string,
+                      },
                     })
                   }}
                   type="button"
diff --git a/examples/react/start-basic-auth/package.json b/examples/react/start-basic-auth/package.json
index 1c6cc4c96..fe778cad1 100644
--- a/examples/react/start-basic-auth/package.json
+++ b/examples/react/start-basic-auth/package.json
@@ -13,7 +13,7 @@
     "@prisma/client": "5.22.0",
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/start": "^1.102.6",
     "prisma": "^5.22.0",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
diff --git a/examples/react/start-basic-react-query/package.json b/examples/react/start-basic-react-query/package.json
index a6bdf3698..1d3b82184 100644
--- a/examples/react/start-basic-react-query/package.json
+++ b/examples/react/start-basic-react-query/package.json
@@ -14,7 +14,7 @@
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/react-router-with-query": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/start": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/start-basic-rsc/package.json b/examples/react/start-basic-rsc/package.json
index c44f40fa6..2dd7dd470 100644
--- a/examples/react/start-basic-rsc/package.json
+++ b/examples/react/start-basic-rsc/package.json
@@ -12,7 +12,7 @@
     "@babel/plugin-syntax-typescript": "^7.25.9",
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/start": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/start-basic/package.json b/examples/react/start-basic/package.json
index 44cde8b6a..033daffe5 100644
--- a/examples/react/start-basic/package.json
+++ b/examples/react/start-basic/package.json
@@ -11,7 +11,7 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/start": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/start-clerk-basic/package.json b/examples/react/start-clerk-basic/package.json
index 820e6c4f8..953128943 100644
--- a/examples/react/start-clerk-basic/package.json
+++ b/examples/react/start-clerk-basic/package.json
@@ -12,7 +12,7 @@
     "@clerk/tanstack-start": "0.9.4",
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/start": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/start-convex-trellaux/package.json b/examples/react/start-convex-trellaux/package.json
index 0208802bd..a2f9e56a1 100644
--- a/examples/react/start-convex-trellaux/package.json
+++ b/examples/react/start-convex-trellaux/package.json
@@ -17,7 +17,7 @@
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/react-router-with-query": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/start": "^1.102.6",
     "concurrently": "^8.2.2",
     "convex": "^1.19.0",
     "ky": "^1.7.4",
diff --git a/examples/react/start-counter/package.json b/examples/react/start-counter/package.json
index a8cba03a7..8b3416957 100644
--- a/examples/react/start-counter/package.json
+++ b/examples/react/start-counter/package.json
@@ -10,7 +10,7 @@
   },
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/start": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "vinxi": "0.5.3"
diff --git a/examples/react/start-large/package.json b/examples/react/start-large/package.json
index e423ce6ab..c2141b19b 100644
--- a/examples/react/start-large/package.json
+++ b/examples/react/start-large/package.json
@@ -14,7 +14,7 @@
     "@tanstack/react-query": "^5.66.0",
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/start": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "redaxios": "^0.5.1",
diff --git a/examples/react/start-supabase-basic/package.json b/examples/react/start-supabase-basic/package.json
index 00537947f..741bd2798 100644
--- a/examples/react/start-supabase-basic/package.json
+++ b/examples/react/start-supabase-basic/package.json
@@ -17,7 +17,7 @@
     "@supabase/supabase-js": "^2.48.1",
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/start": "^1.102.6",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "vinxi": "0.5.3"
diff --git a/examples/react/start-trellaux/package.json b/examples/react/start-trellaux/package.json
index c2fb0e0f9..02fab8c45 100644
--- a/examples/react/start-trellaux/package.json
+++ b/examples/react/start-trellaux/package.json
@@ -14,7 +14,7 @@
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/react-router-with-query": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/start": "^1.102.6",
     "ky": "^1.7.4",
     "msw": "^2.7.0",
     "react": "^19.0.0",
diff --git a/examples/react/with-trpc-react-query/package.json b/examples/react/with-trpc-react-query/package.json
index a9586179c..c0a281988 100644
--- a/examples/react/with-trpc-react-query/package.json
+++ b/examples/react/with-trpc-react-query/package.json
@@ -12,8 +12,8 @@
     "@tanstack/react-query-devtools": "^5.66.0",
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
+    "@tanstack/start": "^1.102.6",
     "@trpc/client": "11.0.0-rc.749",
     "@trpc/react-query": "11.0.0-rc.749",
     "@trpc/server": "11.0.0-rc.749",
diff --git a/examples/react/with-trpc/package.json b/examples/react/with-trpc/package.json
index 5351cacfb..eff2e5a9d 100644
--- a/examples/react/with-trpc/package.json
+++ b/examples/react/with-trpc/package.json
@@ -10,8 +10,8 @@
   "dependencies": {
     "@tanstack/react-router": "^1.102.5",
     "@tanstack/router-devtools": "^1.102.5",
-    "@tanstack/router-plugin": "^1.102.5",
-    "@tanstack/start": "^1.102.5",
+    "@tanstack/router-plugin": "^1.102.6",
+    "@tanstack/start": "^1.102.6",
     "@trpc/client": "11.0.0-rc.749",
     "@trpc/server": "11.0.0-rc.749",
     "react": "^19.0.0",
diff --git a/packages/create-router/package.json b/packages/create-router/package.json
index 7a160d90a..a04cf4659 100644
--- a/packages/create-router/package.json
+++ b/packages/create-router/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/create-router",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/create-start/package.json b/packages/create-start/package.json
index eca654e71..4a445f743 100644
--- a/packages/create-start/package.json
+++ b/packages/create-start/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/create-start",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tim O'Connell",
   "license": "MIT",
diff --git a/packages/router-cli/package.json b/packages/router-cli/package.json
index e784840a8..bd01e30bc 100644
--- a/packages/router-cli/package.json
+++ b/packages/router-cli/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-cli",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/router-generator/package.json b/packages/router-generator/package.json
index 19c677c8d..bcd2f6649 100644
--- a/packages/router-generator/package.json
+++ b/packages/router-generator/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-generator",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/router-generator/src/generator.ts b/packages/router-generator/src/generator.ts
index 7dd7d62d4..15fbcf93e 100644
--- a/packages/router-generator/src/generator.ts
+++ b/packages/router-generator/src/generator.ts
@@ -1,9 +1,9 @@
 import path from 'node:path'
 import * as fs from 'node:fs'
 import * as fsp from 'node:fs/promises'
-import * as prettier from 'prettier'
 import {
   determineInitialRoutePath,
+  format,
   logging,
   multiSortBy,
   removeExt,
@@ -76,12 +76,6 @@ export async function generator(config: Config, root: string) {
 
   const TYPES_DISABLED = config.disableTypes
 
-  const prettierOptions: prettier.Options = {
-    semi: config.semicolons,
-    singleQuote: config.quoteStyle === 'single',
-    parser: 'typescript',
-  }
-
   let getRouteNodesResult: GetRouteNodesResult
 
   if (config.virtualRouteConfig) {
@@ -138,17 +132,22 @@ export async function generator(config: Config, root: string) {
 
     if (!routeCode) {
       const _rootTemplate = ROUTE_TEMPLATE.rootRoute
-      const replaced = fillTemplate(_rootTemplate.template(), {
+      const replaced = await fillTemplate(config, _rootTemplate.template(), {
         tsrImports: _rootTemplate.imports.tsrImports(),
         tsrPath: rootPathId,
         tsrExportStart: _rootTemplate.imports.tsrExportStart(),
         tsrExportEnd: _rootTemplate.imports.tsrExportEnd(),
       })
 
-      logger.log(`🟡 Creating ${node.fullPath}`)
-      fs.writeFileSync(
+      await writeIfDifferent(
         node.fullPath,
-        await prettier.format(replaced, prettierOptions),
+        '', // Empty string because the file doesn't exist yet
+        replaced,
+        {
+          beforeWrite: () => {
+            logger.log(`🟡 Creating ${node.fullPath}`)
+          },
+        },
       )
     }
   }
@@ -208,7 +207,8 @@ export async function generator(config: Config, root: string) {
         if (node.isLazy) {
           // Check by default check if the user has a specific lazy route template
           // If not, check if the user has a route template and use that instead
-          replaced = fillTemplate(
+          replaced = await fillTemplate(
+            config,
             (config.customScaffolding?.lazyRouteTemplate ||
               config.customScaffolding?.routeTemplate) ??
               tLazyRouteTemplate.template(),
@@ -227,7 +227,8 @@ export async function generator(config: Config, root: string) {
             !node.isPendingComponent &&
             !node.isLoader)
         ) {
-          replaced = fillTemplate(
+          replaced = await fillTemplate(
+            config,
             config.customScaffolding?.routeTemplate ??
               tRouteTemplate.template(),
             {
@@ -260,17 +261,11 @@ export async function generator(config: Config, root: string) {
           )
       }
 
-      await writeIfDifferent(
-        node.fullPath,
-        prettierOptions,
-        routeCode,
-        replaced,
-        {
-          beforeWrite: () => {
-            logger.log(`🟡 Updating ${node.fullPath}`)
-          },
+      await writeIfDifferent(node.fullPath, routeCode, replaced, {
+        beforeWrite: () => {
+          logger.log(`🟡 Updating ${node.fullPath}`)
         },
-      )
+      })
     }
 
     if (
@@ -390,7 +385,8 @@ export async function generator(config: Config, root: string) {
     const escapedRoutePath = node.routePath?.replaceAll('$', '$$') ?? ''
 
     if (!routeCode) {
-      const replaced = fillTemplate(
+      const replaced = await fillTemplate(
+        config,
         config.customScaffolding?.apiTemplate ?? defaultAPIRouteTemplate,
         {
           tsrImports:
@@ -401,15 +397,19 @@ export async function generator(config: Config, root: string) {
         },
       )
 
-      logger.log(`🟡 Creating ${node.fullPath}`)
-      fs.writeFileSync(
+      await writeIfDifferent(
         node.fullPath,
-        await prettier.format(replaced, prettierOptions),
+        '', // Empty string because the file doesn't exist yet
+        replaced,
+        {
+          beforeWrite: () => {
+            logger.log(`🟡 Creating ${node.fullPath}`)
+          },
+        },
       )
     } else {
       await writeIfDifferent(
         node.fullPath,
-        prettierOptions,
         routeCode,
         routeCode.replace(
           /(createAPIFileRoute\(\s*['"])([^\s]*)(['"],?\s*\))/g,
@@ -748,9 +748,8 @@ export async function generator(config: Config, root: string) {
   // Write the route tree file, if it has changed
   const routeTreeWriteResult = await writeIfDifferent(
     path.resolve(config.generatedRouteTree),
-    prettierOptions,
-    existingRouteTreeContent,
-    routeConfigFileContent,
+    await format(existingRouteTreeContent, config),
+    await format(routeConfigFileContent, config),
     {
       beforeWrite: () => {
         logger.log(`🟡 Updating ${config.generatedRouteTree}`)
diff --git a/packages/router-generator/src/template.ts b/packages/router-generator/src/template.ts
index 2870f2492..02016a598 100644
--- a/packages/router-generator/src/template.ts
+++ b/packages/router-generator/src/template.ts
@@ -1,15 +1,18 @@
+import { format } from './utils'
 import type { Config } from './config'
 
 type TemplateTag = 'tsrImports' | 'tsrPath' | 'tsrExportStart' | 'tsrExportEnd'
 
 export function fillTemplate(
+  config: Config,
   template: string,
   values: Record<TemplateTag, string>,
 ) {
-  return template.replace(
+  const replaced = template.replace(
     /%%(\w+)%%/g,
     (_, key) => values[key as TemplateTag] || '',
   )
+  return format(replaced, config)
 }
 
 type TargetTemplate = {
diff --git a/packages/router-generator/src/utils.ts b/packages/router-generator/src/utils.ts
index 1ff4f8383..5155bb43e 100644
--- a/packages/router-generator/src/utils.ts
+++ b/packages/router-generator/src/utils.ts
@@ -1,5 +1,6 @@
 import * as fs from 'node:fs'
 import * as prettier from 'prettier'
+import type { Config } from './config'
 
 export function multiSortBy<T>(
   arr: Array<T>,
@@ -123,7 +124,6 @@ export function removeExt(d: string, keepExtension: boolean = false) {
  * This function writes to a file if the content is different.
  *
  * @param filepath The path to the file
- * @param prettierOptions Prettier options
  * @param content Original content
  * @param incomingContent New content
  * @param callbacks Callbacks to run before and after writing
@@ -131,26 +131,35 @@ export function removeExt(d: string, keepExtension: boolean = false) {
  */
 export async function writeIfDifferent(
   filepath: string,
-  prettierOptions: prettier.Options,
   content: string,
   incomingContent: string,
   callbacks?: { beforeWrite?: () => void; afterWrite?: () => void },
 ): Promise<boolean> {
-  const [formattedContent, updatedContent] = await Promise.all([
-    prettier.format(content, prettierOptions),
-    prettier.format(incomingContent, prettierOptions),
-  ])
-
-  if (formattedContent !== updatedContent) {
+  if (content !== incomingContent) {
     callbacks?.beforeWrite?.()
-    fs.writeFileSync(filepath, updatedContent)
+    fs.writeFileSync(filepath, incomingContent)
     callbacks?.afterWrite?.()
     return true
   }
-
   return false
 }
 
+/**
+ * This function formats the source code using the default formatter (Prettier).
+ *
+ * @param source The content to format
+ * @param config The configuration object
+ * @returns The formatted content
+ */
+export async function format(source: string, config: Config): Promise<string> {
+  const prettierOptions: prettier.Config = {
+    semi: config.semicolons,
+    singleQuote: config.quoteStyle === 'single',
+    parser: 'typescript',
+  }
+  return prettier.format(source, prettierOptions)
+}
+
 /**
  * This function resets the regex index to 0 so that it can be reused
  * without having to create a new regex object or worry about the last
diff --git a/packages/router-plugin/package.json b/packages/router-plugin/package.json
index c751ceac9..c0e826252 100644
--- a/packages/router-plugin/package.json
+++ b/packages/router-plugin/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-plugin",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/router-vite-plugin/package.json b/packages/router-vite-plugin/package.json
index 9faf57eab..f7ef84881 100644
--- a/packages/router-vite-plugin/package.json
+++ b/packages/router-vite-plugin/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/router-vite-plugin",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/start-api-routes/package.json b/packages/start-api-routes/package.json
index 1567a6c88..66e5110f4 100644
--- a/packages/start-api-routes/package.json
+++ b/packages/start-api-routes/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start-api-routes",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
@@ -64,17 +64,16 @@
   "dependencies": {
     "@tanstack/react-router": "workspace:^",
     "@tanstack/start-server": "workspace:^",
-    "@vitejs/plugin-react": "^4.3.4",
     "vinxi": "0.5.3"
   },
   "devDependencies": {
+    "@vitejs/plugin-react": "^4.3.4",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "typescript": "^5.7.2"
   },
   "peerDependencies": {
     "react": ">=18.0.0 || >=19.0.0",
-    "react-dom": ">=18.0.0 || >=19.0.0",
-    "vite": "^6.0.0"
+    "react-dom": ">=18.0.0 || >=19.0.0"
   }
 }
diff --git a/packages/start-config/package.json b/packages/start-config/package.json
index 9cb1cc9c8..6dbc9e30b 100644
--- a/packages/start-config/package.json
+++ b/packages/start-config/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start-config",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
@@ -55,17 +55,16 @@
     "@tanstack/router-generator": "workspace:^",
     "@tanstack/router-plugin": "workspace:^",
     "@tanstack/server-functions-plugin": "workspace:^",
-    "@tanstack/start-server-functions-handler": "workspace:^",
     "@tanstack/start-plugin": "workspace:^",
+    "@tanstack/start-server-functions-handler": "workspace:^",
     "@vitejs/plugin-react": "^4.3.4",
     "import-meta-resolve": "^4.1.0",
+    "nitropack": "^2.10.4",
     "ofetch": "^1.4.1",
     "vite": "^6.1.0",
     "vinxi": "0.5.3",
-    "zod": "^3.24.1",
-    "nitropack": "^2.10.4"
+    "zod": "^3.24.1"
   },
-  "devDependencies": {},
   "peerDependencies": {
     "react": ">=18.0.0 || >=19.0.0",
     "react-dom": ">=18.0.0 || >=19.0.0",
diff --git a/packages/start-plugin/package.json b/packages/start-plugin/package.json
index f61c4059a..09f321099 100644
--- a/packages/start-plugin/package.json
+++ b/packages/start-plugin/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start-plugin",
-  "version": "1.102.2",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/packages/start-plugin/src/compilers.ts b/packages/start-plugin/src/compilers.ts
index edc214241..165e51908 100644
--- a/packages/start-plugin/src/compilers.ts
+++ b/packages/start-plugin/src/compilers.ts
@@ -5,20 +5,6 @@ import { deadCodeElimination } from 'babel-dead-code-elimination'
 import { generateFromAst, parseAst } from '@tanstack/router-utils'
 import type { GeneratorResult, ParseAstOptions } from '@tanstack/router-utils'
 
-export function compileEliminateDeadCode(
-  opts: ParseAstOptions,
-): GeneratorResult {
-  const ast = parseAst(opts)
-  deadCodeElimination(ast)
-  return generateFromAst(ast, {
-    sourceMaps: true,
-    sourceFileName: opts.filename,
-    filename: opts.filename,
-  })
-}
-
-const debug = process.env.TSR_VITE_DEBUG === 'true'
-
 // build these once and reuse them
 const handleServerOnlyCallExpression =
   buildEnvOnlyCallExpressionHandler('server')
@@ -27,7 +13,9 @@ const handleClientOnlyCallExpression =
 
 type CompileOptions = ParseAstOptions & {
   env: 'server' | 'client' | 'ssr'
+  dce?: boolean
 }
+
 type IdentifierConfig = {
   name: string
   type: 'ImportSpecifier' | 'ImportNamespaceSpecifier'
@@ -179,6 +167,10 @@ export function compileStartOutput(opts: CompileOptions): GeneratorResult {
     },
   })
 
+  if (opts.dce ?? true) {
+    deadCodeElimination(ast)
+  }
+
   return generateFromAst(ast, {
     sourceMaps: true,
     sourceFileName: opts.filename,
diff --git a/packages/start-router-manifest/package.json b/packages/start-router-manifest/package.json
index 58d0597c7..d201c5790 100644
--- a/packages/start-router-manifest/package.json
+++ b/packages/start-router-manifest/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start-router-manifest",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
@@ -59,10 +59,10 @@
   },
   "dependencies": {
     "@tanstack/react-router": "workspace:^",
-    "@vitejs/plugin-react": "^4.3.4",
     "vinxi": "0.5.3"
   },
   "devDependencies": {
+    "@vitejs/plugin-react": "^4.3.4",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "typescript": "^5.7.2"
diff --git a/packages/start-server-functions-client/package.json b/packages/start-server-functions-client/package.json
index a2f2381e7..f210f87ac 100644
--- a/packages/start-server-functions-client/package.json
+++ b/packages/start-server-functions-client/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start-server-functions-client",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
@@ -63,11 +63,10 @@
   },
   "dependencies": {
     "@tanstack/server-functions-plugin": "workspace:^",
-    "@tanstack/start-server-functions-fetcher": "workspace:^",
-    "@vitejs/plugin-react": "^4.3.4",
-    "tiny-invariant": "^1.3.3"
+    "@tanstack/start-server-functions-fetcher": "workspace:^"
   },
   "devDependencies": {
+    "@vitejs/plugin-react": "^4.3.4",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "typescript": "^5.7.2"
diff --git a/packages/start-server-functions-fetcher/package.json b/packages/start-server-functions-fetcher/package.json
index d19e9a758..33f362455 100644
--- a/packages/start-server-functions-fetcher/package.json
+++ b/packages/start-server-functions-fetcher/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start-server-functions-fetcher",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
@@ -63,10 +63,10 @@
   },
   "dependencies": {
     "@tanstack/react-router": "workspace:^",
-    "@tanstack/start-client": "workspace:^",
-    "@vitejs/plugin-react": "^4.3.4"
+    "@tanstack/start-client": "workspace:^"
   },
   "devDependencies": {
+    "@vitejs/plugin-react": "^4.3.4",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "typescript": "^5.7.2"
diff --git a/packages/start-server-functions-handler/package.json b/packages/start-server-functions-handler/package.json
index 60ed0234d..e9158931c 100644
--- a/packages/start-server-functions-handler/package.json
+++ b/packages/start-server-functions-handler/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start-server-functions-handler",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
@@ -65,17 +65,16 @@
     "@tanstack/react-router": "workspace:^",
     "@tanstack/start-client": "workspace:^",
     "@tanstack/start-server": "workspace:^",
-    "@vitejs/plugin-react": "^4.3.4",
     "tiny-invariant": "^1.3.3"
   },
   "devDependencies": {
+    "@vitejs/plugin-react": "^4.3.4",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "typescript": "^5.7.2"
   },
   "peerDependencies": {
     "react": ">=18.0.0 || >=19.0.0",
-    "react-dom": ">=18.0.0 || >=19.0.0",
-    "vite": "^6.0.0"
+    "react-dom": ">=18.0.0 || >=19.0.0"
   }
 }
diff --git a/packages/start-server-functions-server/package.json b/packages/start-server-functions-server/package.json
index a52d33498..60f576a4f 100644
--- a/packages/start-server-functions-server/package.json
+++ b/packages/start-server-functions-server/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start-server-functions-server",
-  "version": "1.102.2",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
@@ -63,10 +63,10 @@
   },
   "dependencies": {
     "@tanstack/server-functions-plugin": "workspace:^",
-    "@vitejs/plugin-react": "^4.3.4",
     "tiny-invariant": "^1.3.3"
   },
   "devDependencies": {
+    "@vitejs/plugin-react": "^4.3.4",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "typescript": "^5.7.2"
diff --git a/packages/start-server-functions-ssr/package.json b/packages/start-server-functions-ssr/package.json
index 5b50111c0..cda0a52df 100644
--- a/packages/start-server-functions-ssr/package.json
+++ b/packages/start-server-functions-ssr/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start-server-functions-ssr",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
@@ -66,17 +66,16 @@
     "@tanstack/start-client": "workspace:^",
     "@tanstack/start-server": "workspace:^",
     "@tanstack/start-server-functions-fetcher": "workspace:^",
-    "@vitejs/plugin-react": "^4.3.4",
     "tiny-invariant": "^1.3.3"
   },
   "devDependencies": {
+    "@vitejs/plugin-react": "^4.3.4",
     "react": "^19.0.0",
     "react-dom": "^19.0.0",
     "typescript": "^5.7.2"
   },
   "peerDependencies": {
     "react": ">=18.0.0 || >=19.0.0",
-    "react-dom": ">=18.0.0 || >=19.0.0",
-    "vite": "^6.0.0"
+    "react-dom": ">=18.0.0 || >=19.0.0"
   }
 }
diff --git a/packages/start-server/package.json b/packages/start-server/package.json
index ddb65cc9b..35d128924 100644
--- a/packages/start-server/package.json
+++ b/packages/start-server/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start-server",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
@@ -65,13 +65,13 @@
     "@tanstack/react-cross-context": "workspace:^",
     "@tanstack/react-router": "workspace:^",
     "@tanstack/start-client": "workspace:^",
-    "@vitejs/plugin-react": "^4.3.4",
     "h3": "1.13.0",
     "isbot": "^5.1.22",
     "jsesc": "^3.1.0",
     "unctx": "^2.4.1"
   },
   "devDependencies": {
+    "@vitejs/plugin-react": "^4.3.4",
     "@types/jsesc": "^3.0.3",
     "esbuild": "^0.25.0",
     "react": "^19.0.0",
diff --git a/packages/start/package.json b/packages/start/package.json
index ba1866fac..bdb879d0d 100644
--- a/packages/start/package.json
+++ b/packages/start/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tanstack/start",
-  "version": "1.102.5",
+  "version": "1.102.6",
   "description": "Modern and scalable routing for React applications",
   "author": "Tanner Linsley",
   "license": "MIT",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c11337f9c..1f943f896 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -2494,10 +2494,10 @@ importers:
         version: 19.0.3(@types/react@19.0.8)
       html-webpack-plugin:
         specifier: ^5.6.3
-        version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1)
+        version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
       swc-loader:
         specifier: ^0.2.6
-        version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1)
+        version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
       typescript:
         specifier: ^5.7.2
         version: 5.7.3
@@ -3962,7 +3962,7 @@ importers:
         version: 7.0.6
       html-webpack-plugin:
         specifier: ^5.6.0
-        version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1)
+        version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
       picocolors:
         specifier: ^1.1.1
         version: 1.1.1
@@ -3974,7 +3974,7 @@ importers:
         version: 19.0.0(react@19.0.0)
       swc-loader:
         specifier: ^0.2.6
-        version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1)
+        version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
       tinyglobby:
         specifier: ^0.2.10
         version: 0.2.10
@@ -4498,16 +4498,13 @@ importers:
       '@tanstack/start-server':
         specifier: workspace:*
         version: link:../start-server
-      '@vitejs/plugin-react':
-        specifier: ^4.3.4
-        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       vinxi:
         specifier: 0.5.3
         version: 0.5.3(@types/node@22.13.0)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0)
-      vite:
-        specifier: 6.1.0
-        version: 6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
     devDependencies:
+      '@vitejs/plugin-react':
+        specifier: ^4.3.4
+        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       react:
         specifier: ^19.0.0
         version: 19.0.0
@@ -4650,13 +4647,13 @@ importers:
       '@tanstack/react-router':
         specifier: workspace:*
         version: link:../react-router
-      '@vitejs/plugin-react':
-        specifier: ^4.3.4
-        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       vinxi:
         specifier: 0.5.3
         version: 0.5.3(@types/node@22.13.0)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0)
     devDependencies:
+      '@vitejs/plugin-react':
+        specifier: ^4.3.4
+        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       react:
         specifier: ^19.0.0
         version: 19.0.0
@@ -4678,9 +4675,6 @@ importers:
       '@tanstack/start-client':
         specifier: workspace:*
         version: link:../start-client
-      '@vitejs/plugin-react':
-        specifier: ^4.3.4
-        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       h3:
         specifier: 1.13.0
         version: 1.13.0
@@ -4697,6 +4691,9 @@ importers:
       '@types/jsesc':
         specifier: ^3.0.3
         version: 3.0.3
+      '@vitejs/plugin-react':
+        specifier: ^4.3.4
+        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       esbuild:
         specifier: ^0.25.0
         version: 0.25.0
@@ -4718,13 +4715,10 @@ importers:
       '@tanstack/start-server-functions-fetcher':
         specifier: workspace:*
         version: link:../start-server-functions-fetcher
+    devDependencies:
       '@vitejs/plugin-react':
         specifier: ^4.3.4
         version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
-      tiny-invariant:
-        specifier: ^1.3.3
-        version: 1.3.3
-    devDependencies:
       react:
         specifier: ^19.0.0
         version: 19.0.0
@@ -4743,10 +4737,10 @@ importers:
       '@tanstack/start-client':
         specifier: workspace:*
         version: link:../start-client
+    devDependencies:
       '@vitejs/plugin-react':
         specifier: ^4.3.4
         version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
-    devDependencies:
       react:
         specifier: ^19.0.0
         version: 19.0.0
@@ -4768,16 +4762,13 @@ importers:
       '@tanstack/start-server':
         specifier: workspace:*
         version: link:../start-server
-      '@vitejs/plugin-react':
-        specifier: ^4.3.4
-        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       tiny-invariant:
         specifier: ^1.3.3
         version: 1.3.3
-      vite:
-        specifier: 6.1.0
-        version: 6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
     devDependencies:
+      '@vitejs/plugin-react':
+        specifier: ^4.3.4
+        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       react:
         specifier: ^19.0.0
         version: 19.0.0
@@ -4793,13 +4784,13 @@ importers:
       '@tanstack/server-functions-plugin':
         specifier: workspace:*
         version: link:../server-functions-plugin
-      '@vitejs/plugin-react':
-        specifier: ^4.3.4
-        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       tiny-invariant:
         specifier: ^1.3.3
         version: 1.3.3
     devDependencies:
+      '@vitejs/plugin-react':
+        specifier: ^4.3.4
+        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       react:
         specifier: ^19.0.0
         version: 19.0.0
@@ -4824,16 +4815,13 @@ importers:
       '@tanstack/start-server-functions-fetcher':
         specifier: workspace:*
         version: link:../start-server-functions-fetcher
-      '@vitejs/plugin-react':
-        specifier: ^4.3.4
-        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       tiny-invariant:
         specifier: ^1.3.3
         version: 1.3.3
-      vite:
-        specifier: 6.1.0
-        version: 6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
     devDependencies:
+      '@vitejs/plugin-react':
+        specifier: ^4.3.4
+        version: 4.3.4(vite@6.1.0(@types/node@22.13.0)(jiti@2.4.2)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
       react:
         specifier: ^19.0.0
         version: 19.0.0
@@ -14842,17 +14830,17 @@ snapshots:
       '@webassemblyjs/ast': 1.14.1
       '@xtuc/long': 4.2.2
 
-  '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.97.1)':
+  '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))':
     dependencies:
       webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
       webpack-cli: 5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1)
 
-  '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.97.1)':
+  '@webpack-cli/info@2.0.2(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))':
     dependencies:
       webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
       webpack-cli: 5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1)
 
-  '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.2.0)(webpack@5.97.1)':
+  '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack-dev-server@5.2.0(webpack-cli@5.1.4)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))':
     dependencies:
       webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
       webpack-cli: 5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1)
@@ -16716,7 +16704,7 @@ snapshots:
       relateurl: 0.2.7
       terser: 5.37.0
 
-  html-webpack-plugin@5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1):
+  html-webpack-plugin@5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
     dependencies:
       '@types/html-minifier-terser': 6.1.0
       html-minifier-terser: 6.1.0
@@ -18756,7 +18744,7 @@ snapshots:
       csso: 5.0.5
       picocolors: 1.1.1
 
-  swc-loader@0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1):
+  swc-loader@0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
     dependencies:
       '@swc/core': 1.10.15(@swc/helpers@0.5.15)
       '@swc/counter': 0.1.3
@@ -18844,26 +18832,26 @@ snapshots:
       type-fest: 2.19.0
       unique-string: 3.0.0
 
-  terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)):
+  terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
     dependencies:
       '@jridgewell/trace-mapping': 0.3.25
       jest-worker: 27.5.1
       schema-utils: 4.3.0
       serialize-javascript: 6.0.2
       terser: 5.37.0
-      webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)
+      webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
     optionalDependencies:
       '@swc/core': 1.10.15(@swc/helpers@0.5.15)
       esbuild: 0.25.0
 
-  terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1):
+  terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)):
     dependencies:
       '@jridgewell/trace-mapping': 0.3.25
       jest-worker: 27.5.1
       schema-utils: 4.3.0
       serialize-javascript: 6.0.2
       terser: 5.37.0
-      webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
+      webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)
     optionalDependencies:
       '@swc/core': 1.10.15(@swc/helpers@0.5.15)
       esbuild: 0.25.0
@@ -19608,9 +19596,9 @@ snapshots:
   webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1):
     dependencies:
       '@discoveryjs/json-ext': 0.5.7
-      '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.97.1)
-      '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4)(webpack@5.97.1)
-      '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.2.0)(webpack@5.97.1)
+      '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
+      '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
+      '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack-dev-server@5.2.0(webpack-cli@5.1.4)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
       colorette: 2.0.20
       commander: 10.0.1
       cross-spawn: 7.0.6
@@ -19624,7 +19612,7 @@ snapshots:
     optionalDependencies:
       webpack-dev-server: 5.2.0(webpack-cli@5.1.4)(webpack@5.97.1)
 
-  webpack-dev-middleware@7.4.2(webpack@5.97.1):
+  webpack-dev-middleware@7.4.2(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
     dependencies:
       colorette: 2.0.20
       memfs: 4.17.0
@@ -19662,7 +19650,7 @@ snapshots:
       serve-index: 1.9.1
       sockjs: 0.3.24
       spdy: 4.0.2
-      webpack-dev-middleware: 7.4.2(webpack@5.97.1)
+      webpack-dev-middleware: 7.4.2(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
       ws: 8.18.0
     optionalDependencies:
       webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
@@ -19737,7 +19725,7 @@ snapshots:
       neo-async: 2.6.2
       schema-utils: 3.3.0
       tapable: 2.2.1
-      terser-webpack-plugin: 5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1)
+      terser-webpack-plugin: 5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
       watchpack: 2.4.2
       webpack-sources: 3.2.3
     optionalDependencies:


Test patch:
diff --git a/packages/start-plugin/tests/createIsomorphicFn/createIsomorphicFn.test.ts b/packages/start-plugin/tests/createIsomorphicFn/createIsomorphicFn.test.ts
index 28f29510a..703f79a6b 100644
--- a/packages/start-plugin/tests/createIsomorphicFn/createIsomorphicFn.test.ts
+++ b/packages/start-plugin/tests/createIsomorphicFn/createIsomorphicFn.test.ts
@@ -41,6 +41,7 @@ describe('createIsomorphicFn compiles correctly', async () => {
           code,
           root: './test-files',
           filename,
+          dce: false,
         })
 
         await expect(compiledResult.code).toMatchFileSnapshot(
@@ -58,6 +59,7 @@ describe('createIsomorphicFn compiles correctly', async () => {
         const clientOnly = createIsomorphicFn().client()`,
         root: './test-files',
         filename: 'no-fn.ts',
+        dce: false,
       })
     }).toThrowError()
     expect(() => {
@@ -68,6 +70,7 @@ describe('createIsomorphicFn compiles correctly', async () => {
         const serverOnly = createIsomorphicFn().server()`,
         root: './test-files',
         filename: 'no-fn.ts',
+        dce: false,
       })
     }).toThrowError()
   })
@@ -79,6 +82,7 @@ describe('createIsomorphicFn compiles correctly', async () => {
       const noImpl = createIsomorphicFn()`,
       root: './test-files',
       filename: 'no-fn.ts',
+      dce: false,
     })
     expect(consoleSpy).toHaveBeenCalledWith(
       noImplWarning,
diff --git a/packages/start-plugin/tests/createMiddleware/createMiddleware.test.ts b/packages/start-plugin/tests/createMiddleware/createMiddleware.test.ts
index ae4ee2c22..05d57dd32 100644
--- a/packages/start-plugin/tests/createMiddleware/createMiddleware.test.ts
+++ b/packages/start-plugin/tests/createMiddleware/createMiddleware.test.ts
@@ -25,6 +25,7 @@ describe('createMiddleware compiles correctly', async () => {
           code,
           root: './test-files',
           filename,
+          dce: false,
         })
 
         await expect(compiledResult.code).toMatchFileSnapshot(
diff --git a/packages/start-plugin/tests/createServerFn/createServerFn.test.ts b/packages/start-plugin/tests/createServerFn/createServerFn.test.ts
index d46d1babb..bff1f665f 100644
--- a/packages/start-plugin/tests/createServerFn/createServerFn.test.ts
+++ b/packages/start-plugin/tests/createServerFn/createServerFn.test.ts
@@ -25,6 +25,7 @@ describe('createServerFn compiles correctly', async () => {
           code,
           root: './test-files',
           filename,
+          dce: false,
         })
 
         await expect(compiledResult.code).toMatchFileSnapshot(
@@ -43,6 +44,7 @@ describe('createServerFn compiles correctly', async () => {
         createServerFn()`,
         root: './test-files',
         filename: 'no-fn.ts',
+        dce: false,
       })
     }).toThrowError()
   })
@@ -56,6 +58,7 @@ describe('createServerFn compiles correctly', async () => {
         createServerFn().handler(async () => {})`,
         root: './test-files',
         filename: 'no-fn.ts',
+        dce: false,
       })
     }).toThrowError()
   })
@@ -73,6 +76,7 @@ describe('createServerFn compiles correctly', async () => {
       filename: 'test.ts',
       code,
       env: 'client',
+      dce: false,
     })
 
     const compiledResultServer = compileStartOutput({
@@ -80,6 +84,7 @@ describe('createServerFn compiles correctly', async () => {
       filename: 'test.ts',
       code,
       env: 'server',
+      dce: false,
     })
 
     expect(compiledResultClient.code).toMatchInlineSnapshot(`
@@ -103,4 +108,56 @@ describe('createServerFn compiles correctly', async () => {
       }, myFunc);"
     `)
   })
+
+  test('should use dce by default', () => {
+    const code = `
+      import { createServerFn } from '@tanstack/start'
+      const exportedVar = 'exported'
+      export const exportedFn = createServerFn().handler(async () => {
+        return exportedVar
+      })
+      const nonExportedVar = 'non-exported'
+      const nonExportedFn = createServerFn().handler(async () => {
+        return nonExportedVar
+      })`
+
+    // Client
+    const compiledResult = compileStartOutput({
+      root: '/test',
+      filename: 'test.ts',
+      code,
+      env: 'client',
+      dce: true,
+    })
+
+    expect(compiledResult.code).toMatchInlineSnapshot(`
+      "import { createServerFn } from '@tanstack/start';
+      export const exportedFn = createServerFn().handler(opts => {
+        "use server";
+
+        return exportedFn.__executeServer(opts);
+      });"
+    `)
+
+    // Server
+    const compiledResultServer = compileStartOutput({
+      root: '/test',
+      filename: 'test.ts',
+      code,
+      env: 'server',
+      dce: true,
+    })
+
+    expect(compiledResultServer.code).toMatchInlineSnapshot(`
+      "import { createServerFn } from '@tanstack/start';
+      const exportedVar = 'exported';
+      export const exportedFn = createServerFn().handler(opts => {
+        "use server";
+
+        return exportedFn.__executeServer(opts);
+      }, async () => {
+        return exportedVar;
+      });"
+    `)
+  })
 })
diff --git a/packages/start-plugin/tests/envOnly/envOnly.test.ts b/packages/start-plugin/tests/envOnly/envOnly.test.ts
index 67336be35..ba6107fb7 100644
--- a/packages/start-plugin/tests/envOnly/envOnly.test.ts
+++ b/packages/start-plugin/tests/envOnly/envOnly.test.ts
@@ -25,6 +25,7 @@ describe('envOnly functions compile correctly', async () => {
           code,
           root: './test-files',
           filename,
+          dce: false,
         })
 
         await expect(compiledResult.code).toMatchFileSnapshot(
@@ -42,6 +43,7 @@ describe('envOnly functions compile correctly', async () => {
         const fn = clientOnly()`,
         root: './test-files',
         filename: 'no-fn.ts',
+        dce: false,
       })
     }).toThrowError()
     expect(() => {
@@ -52,6 +54,7 @@ describe('envOnly functions compile correctly', async () => {
         const fn = serverOnly()`,
         root: './test-files',
         filename: 'no-fn.ts',
+        dce: false,
       })
     }).toThrowError()
   })