build: always ensure node_modules folders are not picked up in AIO (#48329)

AIO has two risk places where `node_modules` folders may exist and may
be accidentally picked up by Bazel- even though they are already added
as part of `.bazelignore` and made visible through `.gitignore`. It
doesn't hurt instructing Bazel to always ignore `node_modules` as part
of the `glob` instruction.

Co-authored-by: Joey Perrott <josephperrott@gmail.com>

PR Close #48329
This commit is contained in:
Paul Gschwendtner
2022-12-02 16:36:23 +00:00
committed by Andrew Kushnir
parent eb43ed25eb
commit 0125677cfe
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -115,7 +115,10 @@ def docs_example(name, test = True, test_tags = [], test_exec_properties = {}, f
native.filegroup(
name = "files",
srcs = native.glob(["**"], exclude = ["BUILD.bazel"]),
srcs = native.glob(["**"], exclude = [
"BUILD.bazel",
"**/node_modules/**", # Node modules may exist from the legacy setup.
]),
)
# Generate example boilerplate
+4 -1
View File
@@ -4,6 +4,9 @@ filegroup(
name = "shared",
srcs = glob(
["**"],
exclude = ["BUILD.bazel"],
exclude = [
"BUILD.bazel",
"**/node_modules/**", # Node modules may exist from the legacy setup.
],
),
)