Skip to content

Commit

Permalink
fix(esbuild): do not ignore annotations when the minify shorthand a…
Browse files Browse the repository at this point in the history
…ttribute is disabled (#3106)

Pure annotations are currently always ignored if `esbuild(minify = False)`. There are
cases where a consumer will set fine-grained minification options through `args`, but
currently cannot do this without setting `minify = True` as otherwise pure annotations
would always be preserved.

This magical behavior should be removed and the consumer should be
responsible for enabling this if tree-shaking is undesirable.
  • Loading branch information
devversion authored and alexeagle committed Dec 3, 2021
1 parent b62e1e8 commit b1275c5
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/esbuild/esbuild.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ def _esbuild_impl(ctx):

if ctx.attr.minify:
args.update({"minify": True})
else:
# by default, esbuild will tree-shake 'pure' functions
# disable this unless also minifying
args.update({"ignoreAnnotations": True})

if ctx.attr.splitting:
if not ctx.attr.output_dir:
Expand Down

0 comments on commit b1275c5

Please sign in to comment.