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[] {
35
35
return {
36
36
appType : env . isPreview ? 'mpa' : undefined ,
37
37
rsc : {
38
- useBuildAppHook : true ,
39
38
serverHandler : env . isPreview ? false : undefined ,
40
39
} ,
41
40
}
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ export default defineConfig({
17
17
} ,
18
18
serverHandler : false ,
19
19
loadModuleDevProxy : true ,
20
- useBuildAppHook : true ,
21
20
} ) ,
22
21
cloudflare ( {
23
22
configPath : './wrangler.jsonc' ,
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ export type RscPluginOptions = {
174
174
/**
175
175
* use `Plugin.buildApp` hook (introduced on Vite 7) instead of `builder.buildApp` configuration
176
176
* for better composability with other plugins.
177
- * @default false
177
+ * @default true since Vite 7
178
178
*/
179
179
useBuildAppHook ?: boolean
180
180
@@ -428,6 +428,11 @@ export default function vitePluginRsc(
428
428
} ,
429
429
}
430
430
} ,
431
+ configResolved ( ) {
432
+ if ( Number ( vite . version . split ( '.' ) [ 0 ] ) >= 7 ) {
433
+ rscPluginOptions . useBuildAppHook ??= true
434
+ }
435
+ } ,
431
436
buildApp : {
432
437
async handler ( builder ) {
433
438
if ( rscPluginOptions . useBuildAppHook ) {
You can’t perform that action at this time.
0 commit comments