Skip to content

Commit

Permalink
build(bazel): esm5_outputs_aspect to work with targets such as ts_pro…
Browse files Browse the repository at this point in the history
…to_library with no replay_params attribute

Workaround was added in #25335. It was necessary for .ngfactory & .ngsummary files to have proper AMD module names starting with @angular when building angular downstream from source using Bazel. The underlying issue has been resolved in the compiler and these files now get proper AMD module names without the need for this workaround. The workaround had an unexpected consequence angular/angular-cli#11835 which is fixed by its removal.
  • Loading branch information
gregmagolan committed Aug 21, 2018
1 parent f33dbf4 commit fecc258
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/bazel/src/esm5.bzl
Expand Up @@ -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)

Expand Down

0 comments on commit fecc258

Please sign in to comment.