@@ -62,37 +62,38 @@ export async function loadFixture(testContext: VitestContext) {
6262 const buildDir = resolve ( ctx . options . rootDir , '.nuxt' , testKey )
6363 const outputDir = resolve ( ctx . options . rootDir , '.output' , testKey )
6464
65- ctx . options . nuxtConfig = defu ( ctx . options . nuxtConfig , {
66- buildDir,
67- modules : [
68- ( _ , nuxt ) => {
69- /**
70- * Register nitro plugin for IPC communication to update runtime config
71- */
72- nuxt . options . nitro . plugins ||= [ ]
73- nuxt . options . nitro . plugins . push ( fileURLToPath ( new URL ( './nitro-plugin' , import . meta. url ) ) )
74- /**
75- * The `overrides` option is only used for testing, it is used to option overrides to the project layer in a fixture.
76- */
77- if ( nuxt . options ?. i18n ?. overrides ) {
78- const project = nuxt . options . _layers [ 0 ]
79- const { overrides, ...mergedOptions } = nuxt . options . i18n
80- delete nuxt . options . i18n . overrides
81- project . config . i18n = defu ( overrides , project . config . i18n )
82- Object . assign ( nuxt . options . i18n , defu ( overrides , mergedOptions ) )
65+ ctx . options . nuxtConfig = defu (
66+ ctx . options . nuxtConfig ,
67+ {
68+ buildDir,
69+ modules : [
70+ ( _ , nuxt ) => {
71+ /**
72+ * Register nitro plugin for IPC communication to update runtime config
73+ */
74+ nuxt . options . nitro . plugins ||= [ ]
75+ nuxt . options . nitro . plugins . push ( fileURLToPath ( new URL ( './nitro-plugin' , import . meta. url ) ) )
76+ /**
77+ * The `overrides` option is only used for testing, it is used to option overrides to the project layer in a fixture.
78+ */
79+ if ( nuxt . options ?. i18n ?. overrides ) {
80+ const project = nuxt . options . _layers [ 0 ]
81+ const { overrides, ...mergedOptions } = nuxt . options . i18n
82+ delete nuxt . options . i18n . overrides
83+ project . config . i18n = defu ( overrides , project . config . i18n )
84+ Object . assign ( nuxt . options . i18n , defu ( overrides , mergedOptions ) )
85+ }
86+ }
87+ ] ,
88+ _generate : ctx . options . prerender ,
89+ nitro : {
90+ output : {
91+ dir : outputDir
8392 }
8493 }
85- ] ,
86- // NOTE: the following code is added for prerender
87- _generate : ctx . options . prerender ,
88- nitro : {
89- ...( ctx . options . prerender ? { static : true } : { } ) ,
90- output : {
91- dir : outputDir ,
92- ...( ctx . options . prerender ? { publicDir : resolve ( outputDir , 'public' ) } : { } )
93- }
94- }
95- } )
94+ } ,
95+ ctx . options . prerender ? { nitro : { static : true , output : { publicDir : resolve ( outputDir , 'public' ) } } } : { }
96+ )
9697 }
9798
9899 ctx . nuxt = await kit . loadNuxt ( {
0 commit comments