Skip to content
Permalink
Browse files

feat(bazel): add ts_config extending support for ng_module (#21883)

PR Close #21883
  • Loading branch information...
adamyi authored and mhevery committed Jan 30, 2018
1 parent 3cb497c commit edb6c2d8148ab51f9d980da62c63274b1035ee3c
Showing with 9 additions and 0 deletions.
  1. +6 −0 packages/bazel/src/external.bzl
  2. +3 −0 packages/bazel/src/ng_module.bzl
@@ -18,9 +18,14 @@ load(
_NodeModuleInfo = "NodeModuleInfo",
_collect_node_modules_aspect = "collect_node_modules_aspect",
)
load(
"@npm_bazel_typescript//internal:ts_config.bzl",
_TsConfigInfo = "TsConfigInfo",
)

NodeModuleInfo = _NodeModuleInfo
collect_node_modules_aspect = _collect_node_modules_aspect

tsc_wrapped_tsconfig = _tsc_wrapped_tsconfig
COMMON_ATTRIBUTES = _COMMON_ATTRIBUTES
COMMON_OUTPUTS = _COMMON_OUTPUTS
@@ -31,3 +36,4 @@ ts_providers_dict_to_struct = _ts_providers_dict_to_struct
DEFAULT_NG_COMPILER = "@angular//:@angular/bazel/ngc-wrapped"
DEFAULT_NG_XI18N = "@npm//@angular/bazel/bin:xi18n"
FLAT_DTS_FILE_SUFFIX = ".bundle.d.ts"
TsConfigInfo = _TsConfigInfo
@@ -13,6 +13,7 @@ load(
"DEFAULT_NG_XI18N",
"DEPS_ASPECTS",
"NodeModuleInfo",
"TsConfigInfo",
"collect_node_modules_aspect",
"compile_ts",
"ts_providers_dict_to_struct",
@@ -463,6 +464,8 @@ def _compile_action(ctx, inputs, outputs, dts_bundle_out, messages_out, tsconfig
# If the user supplies a tsconfig.json file, the Angular compiler needs to read it
if hasattr(ctx.attr, "tsconfig") and ctx.file.tsconfig:
file_inputs.append(ctx.file.tsconfig)
if TsConfigInfo in ctx.attr.tsconfig:
file_inputs += ctx.attr.tsconfig[TsConfigInfo].deps

# Also include files from npm fine grained deps as action_inputs.
# These deps are identified by the NodeModuleInfo provider.

0 comments on commit edb6c2d

Please sign in to comment.
You can’t perform that action at this time.