Skip to content

Commit 70920e0

Browse files
devversionclydin
authored andcommitted
build: update to more improved copy_to_bin rule.
This is necessary as the current rule is not clever enough to detect when a given file is already "generated" and inside `bin`. This is important because `package.json` files are always copied to bin for `npm_package`, but the `package.json` may already be copied from e.g. `ts_project#data`. This shouldn't cause a Bazel action conflict.
1 parent f6ff9cc commit 70920e0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/defaults.bzl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""Re-export of some bazel rules with repository-wide defaults."""
22

3+
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
34
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
45
load("@aspect_bazel_lib//lib:jq.bzl", "jq")
56
load("@aspect_bazel_lib//lib:utils.bzl", "to_label")
6-
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", _js_library = "js_library", _pkg_npm = "pkg_npm")
7+
load("@build_bazel_rules_nodejs//:index.bzl", _js_library = "js_library", _pkg_npm = "pkg_npm")
78
load("@npm//@angular/bazel:index.bzl", _ng_module = "ng_module", _ng_package = "ng_package")
89
load("@npm//@angular/build-tooling/bazel:extract_js_module_output.bzl", "extract_js_module_output")
910
load("@npm//@bazel/concatjs:index.bzl", _ts_library = "ts_library")
@@ -184,7 +185,10 @@ def pkg_npm(name, pkg_deps = [], use_prodmode_output = False, **kwargs):
184185
"substituted/": "",
185186
},
186187
exclude_srcs_patterns = [
187-
"packages/**/*", # Exclude compiled outputs of dependent packages
188+
# Exclude compiled outputs of dependent packages
189+
"packages/**/*",
190+
# Exclude `node_modules` which may be pulled by the `js_module_output` runfiles.
191+
"node_modules/**/*",
188192
],
189193
allow_overwrites = True,
190194
)

0 commit comments

Comments
 (0)