@@ -62,7 +62,6 @@ def _esbuild_impl(ctx):
62
62
args .add ("--preserve-symlinks" )
63
63
args .add_joined (["--platform" , ctx .attr .platform ], join_with = "=" )
64
64
args .add_joined (["--target" , ctx .attr .target ], join_with = "=" )
65
- args .add_joined (["--log-level" , "info" ], join_with = "=" )
66
65
args .add_joined (["--metafile" , metafile .path ], join_with = "=" )
67
66
args .add_all (ctx .attr .define , format_each = "--define:%s" )
68
67
args .add_all (ctx .attr .external , format_each = "--external:%s" )
@@ -111,7 +110,19 @@ def _esbuild_impl(ctx):
111
110
args .add_joined (["--tsconfig" , jsconfig_file .path ], join_with = "=" )
112
111
inputs .append (jsconfig_file )
113
112
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 = "=" )
115
126
116
127
env = {}
117
128
if ctx .attr .max_threads > 0 :
0 commit comments