@@ -100,50 +100,17 @@ function nitroEnv(ctx: NitroPluginContext): VitePlugin {
100100 ...createServiceEnvironments ( ctx ) ,
101101 nitro : createNitroEnvironment ( ctx ) ,
102102 } ;
103-
104- let clientEntry : string | undefined ;
105- let clientEntryConfigured = ! ! getEntry (
106- userConfig . environments ?. client ?. build ?. rolldownOptions ?. input ||
107- userConfig . environments ?. client ?. build ?. rollupOptions ?. input
108- ) ;
109- if ( ! clientEntryConfigured ) {
110- const rendererTemplate = useNitro ( ctx ) . options . renderer ?. template ;
111- if ( rendererTemplate ) {
112- // Use Nitro renderer template as client entry
113- clientEntry = rendererTemplate ;
114- ctx . nitro ! . logger . info (
115- `Using Nitro renderer template \`${ prettyPath ( rendererTemplate ) } \` as vite client entry.`
116- ) ;
117- } else {
118- // Auto-detect client entry
119- clientEntry = resolveModulePath ( "./entry-client" , {
120- try : true ,
121- extensions : DEFAULT_EXTENSIONS ,
122- from : [ "app" , "src" , "" ] . flatMap ( ( d ) =>
123- [ ctx . nitro ! . options . rootDir , ...ctx . nitro ! . options . scanDirs ] . map (
124- ( s ) => join ( s , d ) + "/"
125- )
126- ) ,
127- } ) ;
128- if ( clientEntry ) {
129- ctx . nitro ! . logger . info ( `Using \`${ prettyPath ( clientEntry ) } \` as vite client entry.` ) ;
130- }
131- }
132- }
133- if ( clientEntry ) {
134- environments . client = {
135- consumer : userConfig . environments ?. client ?. consumer ?? "client" ,
136- build : clientEntryConfigured
137- ? undefined
138- : {
139- rollupOptions : {
140- input : clientEntry ? { index : clientEntry } : undefined ,
141- } ,
142- } ,
143- } ;
144- debug ( "[env] Environments:" , Object . keys ( environments ) . join ( ", " ) ) ;
145- }
146-
103+ environments . client = {
104+ consumer : userConfig . environments ?. client ?. consumer ?? "client" ,
105+ build : {
106+ rollupOptions : {
107+ input :
108+ userConfig . environments ?. client ?. build ?. rollupOptions ?. input ??
109+ useNitro ( ctx ) . options . renderer ?. template ,
110+ } ,
111+ } ,
112+ } ;
113+ debug ( "[env] Environments:" , Object . keys ( environments ) . join ( ", " ) ) ;
147114 return {
148115 environments,
149116 } ;
@@ -417,10 +384,7 @@ async function setupNitroContext(
417384 ctx . nitro ! . logger . info ( `Using \`${ prettyPath ( ssrEntry ) } \` as vite ssr entry.` ) ;
418385 }
419386 } else {
420- let ssrEntry = getEntry (
421- userConfig . environments . ssr . build ?. rolldownOptions ?. input ||
422- userConfig . environments . ssr . build ?. rollupOptions ?. input
423- ) ;
387+ let ssrEntry = getEntry ( userConfig . environments . ssr . build ?. rollupOptions ?. input ) ;
424388 if ( typeof ssrEntry === "string" ) {
425389 ssrEntry =
426390 resolveModulePath ( ssrEntry , {
0 commit comments