From 72945c9aef1a656e804384e6657844ab0d2edffe Mon Sep 17 00:00:00 2001 From: Manuel Schiller Date: Tue, 6 Jan 2026 11:34:04 +0100 Subject: [PATCH] fix: make sure prerendering runs after other plugins' buildApp hook --- packages/start-plugin-core/src/plugin.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/start-plugin-core/src/plugin.ts b/packages/start-plugin-core/src/plugin.ts index ba193cda0a..508500320c 100644 --- a/packages/start-plugin-core/src/plugin.ts +++ b/packages/start-plugin-core/src/plugin.ts @@ -345,12 +345,13 @@ export function TanStackStartVitePluginCore( } }, }, - // Separate plugin for buildApp hook without enforce: 'pre' + // Separate plugin for buildApp hook with enforce: 'post' // This ensures proper ordering with other plugins that also have - // buildApp hooks with order: 'post'. The enforce: 'pre' on the config plugin - // would cause this hook to run before those others' buildApp, breaking prerendering. + // buildApp hooks with order: 'post'. The enforce: 'post' ensures this + // runs after other plugins (like Nitro) complete their builds. { name: 'tanstack-start-core:post-build', + enforce: 'post', buildApp: { order: 'post', async handler(builder) {