@@ -19,6 +19,7 @@ import { transformSupportedBrowsersToTargets } from '../../utils/esbuild-targets
1919import  {  FileInfo  }  from  '../../utils/index-file/augment-index-html' ; 
2020import  {  IndexHtmlGenerator  }  from  '../../utils/index-file/index-html-generator' ; 
2121import  {  augmentAppWithServiceWorkerEsbuild  }  from  '../../utils/service-worker' ; 
22+ import  {  Spinner  }  from  '../../utils/spinner' ; 
2223import  {  getSupportedBrowsers  }  from  '../../utils/supported-browsers' ; 
2324import  {  BundleStats ,  generateBuildStatsTable  }  from  '../../webpack/utils/stats' ; 
2425import  {  checkCommonJSModules  }  from  './commonjs-checker' ; 
@@ -575,6 +576,21 @@ function createGlobalStylesBundleOptions(
575576  return  buildOptions ; 
576577} 
577578
579+ async  function  withSpinner < T > ( text : string ,  action : ( )  =>  T  |  Promise < T > ) : Promise < T >  { 
580+   const  spinner  =  new  Spinner ( text ) ; 
581+   spinner . start ( ) ; 
582+ 
583+   try  { 
584+     return  await  action ( ) ; 
585+   }  finally  { 
586+     spinner . stop ( ) ; 
587+   } 
588+ } 
589+ 
590+ async  function  withNoProgress < T > ( test : string ,  action : ( )  =>  T  |  Promise < T > ) : Promise < T >  { 
591+   return  action ( ) ; 
592+ } 
593+ 
578594/** 
579595 * Main execution function for the esbuild-based application builder. 
580596 * The options are compatible with the Webpack-based builder. 
@@ -626,10 +642,14 @@ export async function* buildEsbuildBrowser(
626642    } 
627643  } 
628644
645+   const  withProgress : typeof  withSpinner  =  normalizedOptions . progress 
646+     ? withSpinner 
647+     : withNoProgress ; 
648+ 
629649  // Initial build 
630650  let  result : ExecutionResult ; 
631651  try  { 
632-     result  =  await  execute ( normalizedOptions ,  context ) ; 
652+     result  =  await  withProgress ( 'Building...' ,   ( )   =>   execute ( normalizedOptions ,  context ) ) ; 
633653
634654    if  ( shouldWriteResult )  { 
635655      // Write output files 
@@ -653,7 +673,9 @@ export async function* buildEsbuildBrowser(
653673    } 
654674  } 
655675
656-   context . logger . info ( 'Watch mode enabled. Watching for file changes...' ) ; 
676+   if  ( normalizedOptions . progress )  { 
677+     context . logger . info ( 'Watch mode enabled. Watching for file changes...' ) ; 
678+   } 
657679
658680  // Setup a watcher 
659681  const  watcher  =  createWatcher ( { 
@@ -675,13 +697,13 @@ export async function* buildEsbuildBrowser(
675697  // Wait for changes and rebuild as needed 
676698  try  { 
677699    for  await  ( const  changes  of  watcher )  { 
678-       context . logger . info ( 'Changes detected. Rebuilding...' ) ; 
679- 
680700      if  ( userOptions . verbose )  { 
681701        context . logger . info ( changes . toDebugString ( ) ) ; 
682702      } 
683703
684-       result  =  await  execute ( normalizedOptions ,  context ,  result . createRebuildState ( changes ) ) ; 
704+       result  =  await  withProgress ( 'Changes detected. Rebuilding...' ,  ( )  => 
705+         execute ( normalizedOptions ,  context ,  result . createRebuildState ( changes ) ) , 
706+       ) ; 
685707
686708      if  ( shouldWriteResult )  { 
687709        // Write output files 
0 commit comments