Warnings as errors
Apologies if this already a thing that I can't find in the docs, but is it possible to have esbuild not exit 0 when their are warnings? I got caught out today by releasing a bundle that didn't run but the issue was detected by esbuild however CI continued because it passed.
There's no explicit setting for this because I don't think this is a good idea to do in the general case, since esbuild may change warnings from time to time without the expectation that introducing a new warning will break peoples' builds.
You can do this for individual log messages using this feature: https://esbuild.github.io/api/#log-override (by setting the log level to error). That's what I recommend doing.
If you still want to have all warnings stop the build, you can use the JS API instead and then process.exit(1) if there are any warnings.
Closing as this question has been answered.