From 78e8990be7acfffbc351c699fcdb995137a9c527 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Thu, 2 Dec 2021 11:35:32 +0100 Subject: [PATCH] fix(esbuild): do not ignore annotations when the `minify` shorthand attribute is disabled 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. --- packages/esbuild/esbuild.bzl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/esbuild/esbuild.bzl b/packages/esbuild/esbuild.bzl index 7fa217dc85..71cfe0dacc 100644 --- a/packages/esbuild/esbuild.bzl +++ b/packages/esbuild/esbuild.bzl @@ -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: