@@ -2650,7 +2650,7 @@ async function handleSpaMode(
2650
2650
2651
2651
// Write out the HTML file for the SPA
2652
2652
await fse . writeFile ( path . join ( clientBuildDirectory , filename ) , html ) ;
2653
- let prettyDir = path . relative ( process . cwd ( ) , clientBuildDirectory ) ;
2653
+ let prettyDir = path . relative ( viteConfig . root , clientBuildDirectory ) ;
2654
2654
let prettyPath = path . join ( prettyDir , filename ) ;
2655
2655
if ( build . prerender . length > 0 ) {
2656
2656
viteConfig . logger . info (
@@ -2824,7 +2824,7 @@ async function prerenderData(
2824
2824
}
2825
2825
2826
2826
// Write out the .data file
2827
- let outdir = path . relative ( process . cwd ( ) , clientBuildDirectory ) ;
2827
+ let outdir = path . relative ( viteConfig . root , clientBuildDirectory ) ;
2828
2828
let outfile = path . join ( outdir , ...normalizedPath . split ( "/" ) ) ;
2829
2829
await fse . ensureDir ( path . dirname ( outfile ) ) ;
2830
2830
await fse . outputFile ( outfile , data ) ;
@@ -2883,7 +2883,7 @@ async function prerenderRoute(
2883
2883
}
2884
2884
2885
2885
// Write out the HTML file
2886
- let outdir = path . relative ( process . cwd ( ) , clientBuildDirectory ) ;
2886
+ let outdir = path . relative ( viteConfig . root , clientBuildDirectory ) ;
2887
2887
let outfile = path . join ( outdir , ...normalizedPath . split ( "/" ) , "index.html" ) ;
2888
2888
await fse . ensureDir ( path . dirname ( outfile ) ) ;
2889
2889
await fse . outputFile ( outfile , html ) ;
@@ -2916,7 +2916,7 @@ async function prerenderResourceRoute(
2916
2916
}
2917
2917
2918
2918
// Write out the resource route file
2919
- let outdir = path . relative ( process . cwd ( ) , clientBuildDirectory ) ;
2919
+ let outdir = path . relative ( viteConfig . root , clientBuildDirectory ) ;
2920
2920
let outfile = path . join ( outdir , ...normalizedPath . split ( "/" ) ) ;
2921
2921
await fse . ensureDir ( path . dirname ( outfile ) ) ;
2922
2922
await fse . outputFile ( outfile , content ) ;
0 commit comments