shabunc
shabunc

Reputation: 24741

Can I ignore some folder (containing bazel configuration) while building the project recursively?

For some reasons, practical or not, rxjs npm package stores BAZEL.build configuration in the package, so when I'm trying to build my project (which has node_modules folder) bazel tries automatically to build something that it's not supposed to build at all.

My question would be - what is canonical way of ignoring some specific folder while building bazel project recursively?

The only way to achieve what I'm looking for that I know of is to point to it explicitly in the command line

bazel build //... --deleted_packages=node_modules/rxjs/src (see user manual)

But I don't want to type this every time.

Upvotes: 5

Views: 16889

Answers (2)

mjduijn
mjduijn

Reputation: 161

Bazel recently added a feature for ignoring folders (similar to gitignore).

Simply add node_modules to the .bazelignore file in the root of your project.

Upvotes: 14

Adam
Adam

Reputation: 1805

Yes, this is expressible as a bazel target pattern:

bazel build -- //... -//node_modules/rxjs/src/...

Full documentation is available at https://docs.bazel.build/versions/master/user-manual.html#target-patterns

Upvotes: 11

Related Questions