@@ -62,7 +62,6 @@ def _esbuild_impl(ctx):
6262    args .add ("--preserve-symlinks" )
6363    args .add_joined (["--platform" , ctx .attr .platform ], join_with  =  "=" )
6464    args .add_joined (["--target" , ctx .attr .target ], join_with  =  "=" )
65-     args .add_joined (["--log-level" , "info" ], join_with  =  "=" )
6665    args .add_joined (["--metafile" , metafile .path ], join_with  =  "=" )
6766    args .add_all (ctx .attr .define , format_each  =  "--define:%s" )
6867    args .add_all (ctx .attr .external , format_each  =  "--external:%s" )
@@ -111,7 +110,19 @@ def _esbuild_impl(ctx):
111110    args .add_joined (["--tsconfig" , jsconfig_file .path ], join_with  =  "=" )
112111    inputs .append (jsconfig_file )
113112
114-     args .add_all ([ctx .expand_location (arg ) for  arg  in  ctx .attr .args ])
113+     log_level_flag  =  "--log-level" 
114+     has_log_level_flag  =  False 
115+     for  arg  in  ctx .attr .args :
116+         if  arg .startswith (log_level_flag ):
117+             has_log_level_flag  =  True 
118+ 
119+         args .add (ctx .expand_location (arg ))
120+ 
121+     # by default the log level is "info" and includes an output file summary 
122+     # under bazel this is slightly redundant and may lead to spammy logs 
123+     # unless the user overrides the log level, set it to only show warnings and errors 
124+     if  not  has_log_level_flag :
125+         args .add_joined ([log_level_flag , "warning" ], join_with  =  "=" )
115126
116127    env  =  {}
117128    if  ctx .attr .max_threads  >  0 :
0 commit comments