diff --git a/packages/bazel/src/external.bzl b/packages/bazel/src/external.bzl index 73c74ddf59..982d654eea 100644 --- a/packages/bazel/src/external.bzl +++ b/packages/bazel/src/external.bzl @@ -19,12 +19,14 @@ load( ) load( "@build_bazel_rules_nodejs//:providers.bzl", + _LinkablePackageInfo = "LinkablePackageInfo", _NpmPackageInfo = "NpmPackageInfo", _js_ecma_script_module_info = "js_ecma_script_module_info", _js_named_module_info = "js_named_module_info", _node_modules_aspect = "node_modules_aspect", ) +LinkablePackageInfo = _LinkablePackageInfo NpmPackageInfo = _NpmPackageInfo node_modules_aspect = _node_modules_aspect diff --git a/packages/bazel/src/ng_module.bzl b/packages/bazel/src/ng_module.bzl index 309d69c1e7..db11f59ca5 100644 --- a/packages/bazel/src/ng_module.bzl +++ b/packages/bazel/src/ng_module.bzl @@ -14,6 +14,7 @@ load( "DEFAULT_NG_COMPILER", "DEFAULT_NG_XI18N", "DEPS_ASPECTS", + "LinkablePackageInfo", "NpmPackageInfo", "TsConfigInfo", "compile_ts", @@ -650,6 +651,15 @@ def _ng_module_impl(ctx): # once it is no longer needed. ]) + if ctx.attr.module_name: + path = "/".join([p for p in [ctx.bin_dir.path, ctx.label.workspace_root, ctx.label.package] if p]) + ts_providers["providers"].append(LinkablePackageInfo( + package_name = ctx.attr.module_name, + path = path, + files = ts_providers["typescript"]["es5_sources"], + _tslibrary = True, + )) + return ts_providers_dict_to_struct(ts_providers) local_deps_aspects = [node_modules_aspect, _collect_summaries_aspect]