From 366195e182df3da60d21789cc6364a475f67fd6d Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Tue, 21 Aug 2018 15:43:10 -0700 Subject: [PATCH] build(bazel): esm5_outputs_aspect to work with targets such as ts_proto_library with no replay_params attribute (#25605) PR Close #25605 --- packages/bazel/src/esm5.bzl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/bazel/src/esm5.bzl b/packages/bazel/src/esm5.bzl index 097815e486..8b7f3f3745 100644 --- a/packages/bazel/src/esm5.bzl +++ b/packages/bazel/src/esm5.bzl @@ -45,6 +45,13 @@ def _esm5_outputs_aspect(target, ctx): if not hasattr(target, "typescript"): return [] + # Workaround for https://github.com/bazelbuild/rules_typescript/issues/211 + # TODO(gmagolan): generate esm5 output from ts_proto_library and have that + # output work with esm5_outputs_aspect + if not hasattr(target.typescript, "replay_params"): + print("WARNING: no esm5 output from target %s//%s:%s available" % (target.label.workspace_root, target.label.package, target.label.name)) + return [] + # We create a new tsconfig.json file that will have our compilation settings tsconfig = ctx.actions.declare_file("%s_esm5.tsconfig.json" % target.label.name)