feat(bazel): add ts_config extending support for ng_module (#21883)
PR Close #21883
This commit is contained in:
parent
3cb497c6ac
commit
edb6c2d814
@ -18,9 +18,14 @@ load(
|
|||||||
_NodeModuleInfo = "NodeModuleInfo",
|
_NodeModuleInfo = "NodeModuleInfo",
|
||||||
_collect_node_modules_aspect = "collect_node_modules_aspect",
|
_collect_node_modules_aspect = "collect_node_modules_aspect",
|
||||||
)
|
)
|
||||||
|
load(
|
||||||
|
"@npm_bazel_typescript//internal:ts_config.bzl",
|
||||||
|
_TsConfigInfo = "TsConfigInfo",
|
||||||
|
)
|
||||||
|
|
||||||
NodeModuleInfo = _NodeModuleInfo
|
NodeModuleInfo = _NodeModuleInfo
|
||||||
collect_node_modules_aspect = _collect_node_modules_aspect
|
collect_node_modules_aspect = _collect_node_modules_aspect
|
||||||
|
|
||||||
tsc_wrapped_tsconfig = _tsc_wrapped_tsconfig
|
tsc_wrapped_tsconfig = _tsc_wrapped_tsconfig
|
||||||
COMMON_ATTRIBUTES = _COMMON_ATTRIBUTES
|
COMMON_ATTRIBUTES = _COMMON_ATTRIBUTES
|
||||||
COMMON_OUTPUTS = _COMMON_OUTPUTS
|
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_COMPILER = "@angular//:@angular/bazel/ngc-wrapped"
|
||||||
DEFAULT_NG_XI18N = "@npm//@angular/bazel/bin:xi18n"
|
DEFAULT_NG_XI18N = "@npm//@angular/bazel/bin:xi18n"
|
||||||
FLAT_DTS_FILE_SUFFIX = ".bundle.d.ts"
|
FLAT_DTS_FILE_SUFFIX = ".bundle.d.ts"
|
||||||
|
TsConfigInfo = _TsConfigInfo
|
||||||
|
@ -13,6 +13,7 @@ load(
|
|||||||
"DEFAULT_NG_XI18N",
|
"DEFAULT_NG_XI18N",
|
||||||
"DEPS_ASPECTS",
|
"DEPS_ASPECTS",
|
||||||
"NodeModuleInfo",
|
"NodeModuleInfo",
|
||||||
|
"TsConfigInfo",
|
||||||
"collect_node_modules_aspect",
|
"collect_node_modules_aspect",
|
||||||
"compile_ts",
|
"compile_ts",
|
||||||
"ts_providers_dict_to_struct",
|
"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 the user supplies a tsconfig.json file, the Angular compiler needs to read it
|
||||||
if hasattr(ctx.attr, "tsconfig") and ctx.file.tsconfig:
|
if hasattr(ctx.attr, "tsconfig") and ctx.file.tsconfig:
|
||||||
file_inputs.append(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.
|
# Also include files from npm fine grained deps as action_inputs.
|
||||||
# These deps are identified by the NodeModuleInfo provider.
|
# These deps are identified by the NodeModuleInfo provider.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user