File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
build_angular/src/app-shell
build_webpack/src/webpack Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -180,10 +180,9 @@ async function _appShellBuilder(
180180 let spinner : Spinner | undefined ;
181181
182182 try {
183- // Using `.result` instead of `.output` causes Webpack FS cache not to be created.
184183 const [ browserResult , serverResult ] = await Promise . all ( [
185- browserTargetRun . output . toPromise ( ) as Promise < BrowserBuilderOutput > ,
186- serverTargetRun . output . toPromise ( ) as Promise < ServerBuilderOutput > ,
184+ browserTargetRun . result as Promise < BrowserBuilderOutput > ,
185+ serverTargetRun . result as Promise < ServerBuilderOutput > ,
187186 ] ) ;
188187
189188 if ( browserResult . success === false || browserResult . baseOutputPath === undefined ) {
@@ -203,8 +202,7 @@ async function _appShellBuilder(
203202
204203 return { success : false , error : err . message } ;
205204 } finally {
206- // workaround for [tsetse] All Promises in async functions must either be awaited or used in an expression.
207- const _ = Promise . all ( [ browserTargetRun . stop ( ) , serverTargetRun . stop ( ) ] ) ;
205+ await Promise . all ( [ browserTargetRun . stop ( ) , serverTargetRun . stop ( ) ] ) ;
208206 }
209207}
210208
Original file line number Diff line number Diff line change @@ -72,16 +72,20 @@ export function runWebpack(
7272 log ( stats , config ) ;
7373
7474 const statsOptions = typeof config . stats === 'boolean' ? undefined : config . stats ;
75-
76- obs . next ( {
75+ const result = {
7776 success : ! stats . hasErrors ( ) ,
7877 webpackStats : shouldProvideStats ? stats . toJson ( statsOptions ) : undefined ,
7978 emittedFiles : getEmittedFiles ( stats . compilation ) ,
8079 outputPath : stats . compilation . outputOptions . path ,
81- } as unknown as BuildResult ) ;
80+ } as unknown as BuildResult ;
8281
83- if ( ! config . watch ) {
84- webpackCompiler . close ( ( ) => obs . complete ( ) ) ;
82+ if ( config . watch ) {
83+ obs . next ( result ) ;
84+ } else {
85+ webpackCompiler . close ( ( ) => {
86+ obs . next ( result ) ;
87+ obs . complete ( ) ;
88+ } ) ;
8589 }
8690 } ;
8791
You can’t perform that action at this time.
0 commit comments