@@ -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,12 +2835,13 @@ async function prerenderData(
2835
2835
}
2836
2836
2837
2837
// Write out the .data file
2838
- let outdir = path . relative ( process . cwd ( ) , clientBuildDirectory ) ;
2839
- let outfile = path . join ( outdir , ...normalizedPath . split ( "/" ) ) ;
2838
+ let outfile = path . join ( clientBuildDirectory , ...normalizedPath . split ( "/" ) ) ;
2840
2839
await mkdir ( path . dirname ( outfile ) , { recursive : true } ) ;
2841
2840
await writeFile ( outfile , data ) ;
2842
2841
viteConfig . logger . info (
2843
- `Prerender (data): ${ prerenderPath } -> ${ colors . bold ( outfile ) } `
2842
+ `Prerender (data): ${ prerenderPath } -> ${ colors . bold (
2843
+ path . relative ( viteConfig . root , outfile )
2844
+ ) } `
2844
2845
) ;
2845
2846
return data ;
2846
2847
}
@@ -2894,12 +2895,17 @@ async function prerenderRoute(
2894
2895
}
2895
2896
2896
2897
// Write out the HTML file
2897
- let outdir = path . relative ( process . cwd ( ) , clientBuildDirectory ) ;
2898
- let outfile = path . join ( outdir , ...normalizedPath . split ( "/" ) , "index.html" ) ;
2898
+ let outfile = path . join (
2899
+ clientBuildDirectory ,
2900
+ ...normalizedPath . split ( "/" ) ,
2901
+ "index.html"
2902
+ ) ;
2899
2903
await mkdir ( path . dirname ( outfile ) , { recursive : true } ) ;
2900
2904
await writeFile ( outfile , html ) ;
2901
2905
viteConfig . logger . info (
2902
- `Prerender (html): ${ prerenderPath } -> ${ colors . bold ( outfile ) } `
2906
+ `Prerender (html): ${ prerenderPath } -> ${ colors . bold (
2907
+ path . relative ( viteConfig . root , outfile )
2908
+ ) } `
2903
2909
) ;
2904
2910
}
2905
2911
@@ -2927,12 +2933,13 @@ async function prerenderResourceRoute(
2927
2933
}
2928
2934
2929
2935
// Write out the resource route file
2930
- let outdir = path . relative ( process . cwd ( ) , clientBuildDirectory ) ;
2931
- let outfile = path . join ( outdir , ...normalizedPath . split ( "/" ) ) ;
2936
+ let outfile = path . join ( clientBuildDirectory , ...normalizedPath . split ( "/" ) ) ;
2932
2937
await mkdir ( path . dirname ( outfile ) , { recursive : true } ) ;
2933
2938
await writeFile ( outfile , content ) ;
2934
2939
viteConfig . logger . info (
2935
- `Prerender (resource): ${ prerenderPath } -> ${ colors . bold ( outfile ) } `
2940
+ `Prerender (resource): ${ prerenderPath } -> ${ colors . bold (
2941
+ path . relative ( viteConfig . root , outfile )
2942
+ ) } `
2936
2943
) ;
2937
2944
}
2938
2945
0 commit comments