by gfunk911 · 7y ago · 0 comments
What helps is to understand the separate phases of the Bazel build process and look at other Bazel repositories.
To me it’s not as bad as e.g. the mess I remember going through with TypeScript back when you had to write a lot of your own types for libraries you used.
A bunch of the problems I had might be due to out of date js tools, since apparently Bazel has been breaking compatibility a lot pre 1.0. Things I pull from the docs of the main js/ts bazel libraries are more likely to error than work. Will wait a while for things to catch up now that it's 1.0 and check back in next year or something.
Thanks again.
Once you familiarize yourself with the concept of rules and targets, you can follow the instructions for whichever ruleset you want to use. The official one for JS is rules_nodejs[2]
Another thing that really helped me cement my understanding of Bazel was to deep dive into Starlark and write my own rules. The examples repo[3] is a great resource for that
[1] https://docs.bazel.build/versions/0.29.1/tutorial/java.html
[2] https://github.com/bazelbuild/rules_nodejs
[3] https://github.com/bazelbuild/examples/tree/master/rules