Skip to content

Commit

Permalink
perf: do not include sources,types when transitive_sources,type alrea…
Browse files Browse the repository at this point in the history
…dy included
  • Loading branch information
jbedard committed Jun 18, 2024
1 parent 5530259 commit 28af9c3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions js/private/js_helpers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,17 @@ def gather_files_from_js_infos(
for target in targets:
if JsInfo in target:
js_info = target[JsInfo]
if include_sources and hasattr(js_info, "sources"):
files_depsets.append(js_info.sources)
if include_types and hasattr(js_info, "types"):
files_depsets.append(js_info.types)

if include_transitive_sources and hasattr(js_info, "transitive_sources"):
files_depsets.append(js_info.transitive_sources)
elif include_sources and hasattr(js_info, "sources"):
files_depsets.append(js_info.sources)

if include_transitive_types and hasattr(js_info, "transitive_types"):
files_depsets.append(js_info.transitive_types)
elif include_types and hasattr(js_info, "types"):
files_depsets.append(js_info.types)

if include_npm_sources and hasattr(js_info, "npm_sources"):
files_depsets.append(js_info.npm_sources)

Expand Down

0 comments on commit 28af9c3

Please sign in to comment.