@@ -2661,7 +2661,7 @@ async function handleSpaMode(
2661
2661
2662
2662
// Write out the HTML file for the SPA
2663
2663
await writeFile ( path . join ( clientBuildDirectory , filename ) , html ) ;
2664
- let prettyDir = path . relative ( process . cwd ( ) , clientBuildDirectory ) ;
2664
+ let prettyDir = path . relative ( viteConfig . root , clientBuildDirectory ) ;
2665
2665
let prettyPath = path . join ( prettyDir , filename ) ;
2666
2666
if ( build . prerender . length > 0 ) {
2667
2667
viteConfig . logger . info (
@@ -2835,7 +2835,7 @@ async function prerenderData(
2835
2835
}
2836
2836
2837
2837
// Write out the .data file
2838
- let outdir = path . relative ( process . cwd ( ) , clientBuildDirectory ) ;
2838
+ let outdir = path . relative ( viteConfig . root , clientBuildDirectory ) ;
2839
2839
let outfile = path . join ( outdir , ...normalizedPath . split ( "/" ) ) ;
2840
2840
await mkdir ( path . dirname ( outfile ) , { recursive : true } ) ;
2841
2841
await writeFile ( outfile , data ) ;
@@ -2894,7 +2894,7 @@ async function prerenderRoute(
2894
2894
}
2895
2895
2896
2896
// Write out the HTML file
2897
- let outdir = path . relative ( process . cwd ( ) , clientBuildDirectory ) ;
2897
+ let outdir = path . relative ( viteConfig . root , clientBuildDirectory ) ;
2898
2898
let outfile = path . join ( outdir , ...normalizedPath . split ( "/" ) , "index.html" ) ;
2899
2899
await mkdir ( path . dirname ( outfile ) , { recursive : true } ) ;
2900
2900
await writeFile ( outfile , html ) ;
@@ -2927,7 +2927,7 @@ async function prerenderResourceRoute(
2927
2927
}
2928
2928
2929
2929
// Write out the resource route file
2930
- let outdir = path . relative ( process . cwd ( ) , clientBuildDirectory ) ;
2930
+ let outdir = path . relative ( viteConfig . root , clientBuildDirectory ) ;
2931
2931
let outfile = path . join ( outdir , ...normalizedPath . split ( "/" ) ) ;
2932
2932
await mkdir ( path . dirname ( outfile ) , { recursive : true } ) ;
2933
2933
await writeFile ( outfile , content ) ;
0 commit comments