File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ function rscSsgPlugin(): Plugin[] {
3535 return {
3636 appType : env . isPreview ? 'mpa' : undefined ,
3737 rsc : {
38- useBuildAppHook : true ,
3938 serverHandler : env . isPreview ? false : undefined ,
4039 } ,
4140 }
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ export default defineConfig({
1717 } ,
1818 serverHandler : false ,
1919 loadModuleDevProxy : true ,
20- useBuildAppHook : true ,
2120 } ) ,
2221 cloudflare ( {
2322 configPath : './wrangler.jsonc' ,
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ export type RscPluginOptions = {
174174 /**
175175 * use `Plugin.buildApp` hook (introduced on Vite 7) instead of `builder.buildApp` configuration
176176 * for better composability with other plugins.
177- * @default false
177+ * @default true since Vite 7
178178 */
179179 useBuildAppHook ?: boolean
180180
@@ -428,6 +428,11 @@ export default function vitePluginRsc(
428428 } ,
429429 }
430430 } ,
431+ configResolved ( ) {
432+ if ( Number ( vite . version . split ( '.' ) [ 0 ] ) >= 7 ) {
433+ rscPluginOptions . useBuildAppHook ??= true
434+ }
435+ } ,
431436 buildApp : {
432437 async handler ( builder ) {
433438 if ( rscPluginOptions . useBuildAppHook ) {
You can’t perform that action at this time.
0 commit comments