Skip to content

Commit 8bdde46

Browse files
fix: prerendering
1 parent 5438653 commit 8bdde46

4 files changed

Lines changed: 260 additions & 174 deletions

File tree

examples/solid/start-basic-nitro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"devDependencies": {
1818
"@tailwindcss/vite": "^4.1.18",
1919
"@types/node": "^22.5.4",
20-
"nitro": "^3.0.1-alpha.1",
20+
"nitro": "npm:nitro-nightly@latest",
2121
"tailwindcss": "^4.1.18",
2222
"typescript": "^5.7.2",
2323
"vite": "^7.1.7",

examples/solid/start-basic-nitro/vite.config.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,17 @@ export default defineConfig({
1515
projects: ['./tsconfig.json'],
1616
}),
1717
nitro({ preset: 'node-server' }),
18-
tanstackStart(),
18+
tanstackStart({
19+
sitemap: { enabled: false },
20+
prerender: {
21+
enabled: true,
22+
filter: ({ path }) =>
23+
!path.startsWith('/users') &&
24+
!path.startsWith('/this-route-does-not-exist') &&
25+
!path.startsWith('/posts/i-do-not-exist') &&
26+
!path.startsWith('/deferred'),
27+
},
28+
}),
1929
viteSolid({ ssr: true }),
2030
],
2131
})

packages/start-plugin-core/src/plugin.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,13 @@ export function TanStackStartVitePluginCore(
344344
},
345345
}
346346
},
347+
},
348+
// Separate plugin for buildApp hook without enforce: 'pre'
349+
// This ensures proper ordering with other plugins that also have
350+
// buildApp hooks with order: 'post'. The enforce: 'pre' on the config plugin
351+
// would cause this hook to run before those others' buildApp, breaking prerendering.
352+
{
353+
name: 'tanstack-start-core:post-build',
347354
buildApp: {
348355
order: 'post',
349356
async handler(builder) {

0 commit comments

Comments
 (0)