@@ -83,9 +83,10 @@ function serveStatic(
8383 }
8484}
8585
86- function build ( config : webpack . Configuration , args : any ) {
86+ function build ( config : webpack . Configuration , args : any , spinner ?: any ) {
8787 const compiler = createCompiler ( config ) ;
88- const spinner = ora ( 'building' ) . start ( ) ;
88+ spinner = spinner || ora ( ) ;
89+ spinner . start ( 'building' ) ;
8990 return new Promise < webpack . Compiler > ( ( resolve , reject ) => {
9091 compiler . run ( ( err , stats ) => {
9192 spinner . stop ( ) ;
@@ -360,14 +361,15 @@ const command: Command = {
360361 let config : webpack . Configuration ;
361362 args . experimental = args . experimental || { } ;
362363
364+ const spinner = ora ( ) ;
363365 if ( args . mode === 'dev' ) {
364366 config = devConfigFactory ( args ) ;
365367 } else if ( args . mode === 'unit' || args . mode === 'test' ) {
366368 config = unitConfigFactory ( args ) ;
367369 } else if ( args . mode === 'functional' ) {
368370 config = functionalConfigFactory ( args ) ;
369371 } else {
370- config = distConfigFactory ( args ) ;
372+ config = distConfigFactory ( args , spinner ) ;
371373 }
372374
373375 if ( args . serve ) {
@@ -381,7 +383,8 @@ const command: Command = {
381383 return fileWatch ( config , args ) ;
382384 }
383385
384- return build ( config , args ) ;
386+ spinner . text = 'building' ;
387+ return build ( config , args , spinner ) ;
385388 } ,
386389 eject ( helper : Helper ) : EjectOutput {
387390 return {
0 commit comments