File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,12 @@ export async function build(
5656 ) as OutputChunk )
5757
5858 const cssChunk = (
59- siteConfig . mpa ? serverResult : clientResult
59+ siteConfig . mpa ? serverResult : clientResult !
6060 ) . output . find (
6161 ( chunk ) => chunk . type === 'asset' && chunk . fileName . endsWith ( '.css' )
6262 ) as OutputAsset
6363
64- const assets = ( siteConfig . mpa ? serverResult : clientResult ) . output
64+ const assets = ( siteConfig . mpa ? serverResult : clientResult ! ) . output
6565 . filter (
6666 ( chunk ) => chunk . type === 'asset' && ! chunk . fileName . endsWith ( '.css' )
6767 )
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export async function bundle(
3131 config : SiteConfig ,
3232 options : BuildOptions
3333) : Promise < {
34- clientResult : RollupOutput
34+ clientResult : RollupOutput | null
3535 serverResult : RollupOutput
3636 pageToHashMap : Record < string , string >
3737} > {
@@ -142,16 +142,16 @@ export async function bundle(
142142 }
143143 } )
144144
145- let clientResult : RollupOutput
145+ let clientResult : RollupOutput | null
146146 let serverResult : RollupOutput
147147
148148 const spinner = ora ( )
149149 spinner . start ( 'building client + server bundles...' )
150150 try {
151- ; [ clientResult , serverResult ] = await ( Promise . all ( [
152- config . mpa ? null : build ( await resolveViteConfig ( false ) ) ,
153- build ( await resolveViteConfig ( true ) )
154- ] ) as Promise < [ RollupOutput , RollupOutput ] > )
151+ clientResult = config . mpa
152+ ? null
153+ : ( ( await build ( await resolveViteConfig ( false ) ) ) as RollupOutput )
154+ serverResult = ( await build ( await resolveViteConfig ( true ) ) ) as RollupOutput
155155 } catch ( e ) {
156156 spinner . stopAndPersist ( {
157157 symbol : failMark
Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ export async function renderPage(
2424 config : SiteConfig ,
2525 page : string , // foo.md
2626 result : RollupOutput | null ,
27- appChunk : OutputChunk | undefined ,
28- cssChunk : OutputAsset | undefined ,
27+ appChunk : OutputChunk | null ,
28+ cssChunk : OutputAsset | null ,
2929 assets : string [ ] ,
3030 pageToHashMap : Record < string , string > ,
3131 hashMapString : string ,
You can’t perform that action at this time.
0 commit comments