Skip to content

Commit 4990b93

Browse files
gregmagolanmatsko
authored andcommittedMar 14, 2019
fix(bazel): turn off pure call tree shaking for ng_package (#29210)
PR Close #29210
1 parent 08231f0 commit 4990b93

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎packages/bazel/src/ng_package/ng_package.bzl

+7
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ def _rollup(ctx, bundle_name, rollup_config, entry_point, inputs, js_output, for
107107
args.add("--output.name", _global_name(package_name))
108108
args.add("--amd.id", package_name)
109109

110+
# After updating to build_bazel_rules_nodejs 0.27.0+, rollup has been updated to v1.3.1
111+
# which tree shakes @__PURE__ annotations by default. We turn this feature off
112+
# for ng_package as Angular bundles contain these annotations and there are
113+
# test failures if they are removed. See comments in
114+
# https://github.com/angular/angular/pull/29210 for more information.
115+
args.add("--no-treeshake.annotations")
116+
110117
# Note: if the input has external source maps then we need to also install and use
111118
# `rollup-plugin-sourcemaps`, which will require us to use rollup.config.js file instead
112119
# of command line args

0 commit comments

Comments
 (0)
Please sign in to comment.