From 28e835b4bbd9271cbc7abe2a0e42ff273b1e7e84 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 29 Mar 2022 22:44:46 +0200 Subject: [PATCH] feat(bazel): report error when dependency does not provide JS sources in `ng_package` (#45470) Non-JavaScript source-providing targets in the `ng_package` rule can throw-off the entry-point detection and therefore should be flagged. Currently e.g. a genrule-generated static file might unnecessarily cause additional actions to be generated (non-breaking but just unnecessary) PR Close #45470 --- packages/bazel/src/ng_package/ng_package.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/bazel/src/ng_package/ng_package.bzl b/packages/bazel/src/ng_package/ng_package.bzl index 1ecf083a440..6ae0dd3614f 100644 --- a/packages/bazel/src/ng_package/ng_package.bzl +++ b/packages/bazel/src/ng_package/ng_package.bzl @@ -572,8 +572,9 @@ _NG_PACKAGE_ATTRS = dict(PKG_NPM_ATTRS, **{ allow_single_file = [".txt"], ), "deps": attr.label_list( - doc = """Other rules that produce JavaScript outputs, such as `ts_library`.""", + doc = """ Targets that produce production JavaScript outputs, such as `ts_library`.""", aspects = _NG_PACKAGE_DEPS_ASPECTS, + providers = [JSEcmaScriptModuleInfo], cfg = partial_compilation_transition, ), "readme_md": attr.label(allow_single_file = [".md"]),