File tree 3 files changed +10
-10
lines changed
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(
56
56
) as OutputChunk )
57
57
58
58
const cssChunk = (
59
- siteConfig . mpa ? serverResult : clientResult
59
+ siteConfig . mpa ? serverResult : clientResult !
60
60
) . output . find (
61
61
( chunk ) => chunk . type === 'asset' && chunk . fileName . endsWith ( '.css' )
62
62
) as OutputAsset
63
63
64
- const assets = ( siteConfig . mpa ? serverResult : clientResult ) . output
64
+ const assets = ( siteConfig . mpa ? serverResult : clientResult ! ) . output
65
65
. filter (
66
66
( chunk ) => chunk . type === 'asset' && ! chunk . fileName . endsWith ( '.css' )
67
67
)
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export async function bundle(
31
31
config : SiteConfig ,
32
32
options : BuildOptions
33
33
) : Promise < {
34
- clientResult : RollupOutput
34
+ clientResult : RollupOutput | null
35
35
serverResult : RollupOutput
36
36
pageToHashMap : Record < string , string >
37
37
} > {
@@ -142,16 +142,16 @@ export async function bundle(
142
142
}
143
143
} )
144
144
145
- let clientResult : RollupOutput
145
+ let clientResult : RollupOutput | null
146
146
let serverResult : RollupOutput
147
147
148
148
const spinner = ora ( )
149
149
spinner . start ( 'building client + server bundles...' )
150
150
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
155
155
} catch ( e ) {
156
156
spinner . stopAndPersist ( {
157
157
symbol : failMark
Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ export async function renderPage(
24
24
config : SiteConfig ,
25
25
page : string , // foo.md
26
26
result : RollupOutput | null ,
27
- appChunk : OutputChunk | undefined ,
28
- cssChunk : OutputAsset | undefined ,
27
+ appChunk : OutputChunk | null ,
28
+ cssChunk : OutputAsset | null ,
29
29
assets : string [ ] ,
30
30
pageToHashMap : Record < string , string > ,
31
31
hashMapString : string ,
You can’t perform that action at this time.
0 commit comments