fix(bazel): use //:tsconfig.json as the default for ng_module (#29670)

This matches the behavior of ts_library

PR Close #29670
This commit is contained in:
Alex Eagle
2019-04-02 11:42:58 -07:00
committed by Jason Aden
parent 630aaa6bfb
commit b14537a004
5 changed files with 30 additions and 13 deletions

View File

@ -736,3 +736,21 @@ This rule extends the [ts_library] rule.
[ts_library]: http://tsetse.info/api/build_defs.html#ts_library
"""
def ng_module_macro(tsconfig = None, **kwargs):
"""Wraps `ng_module` to set the default for the `tsconfig` attribute.
This must be a macro so that the string is converted to a label in the context of the
workspace that declares the `ng_module` target, rather than the workspace that defines
`ng_module`, or the workspace where the build is taking place.
This macro is re-exported as `ng_module` in the public API.
Args:
tsconfig: the label pointing to a tsconfig.json file
**kwargs: remaining args to pass to the ng_module rule
"""
if not tsconfig:
tsconfig = "//:tsconfig.json"
ng_module(tsconfig = tsconfig, **kwargs)