In this post, I'll make an introduction to what is Bazel, how to use it with the Angular CLI and why it's a good idea to adopt it.
What i...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for this great introduction!
Some questions for you!
With standard CLI build, we can rely on different
environment.ts
files. For example:environment.staging.ts
.angular.json
allowed replacement of defaultenvironment.ts
file with the environment specific one depending on configuration when runningng build --configuration=staging
for example.How this can be achieve when migrating to Bazel? Adding bazel to project basically deletes everything related to specific configurations and file replacements.
I have the same problem, any solution for this issue?
Wow. Thanks for the Bazel Intro 🎉
Once this is mandatory ... I already see so many hours of my life being wasted to
a) manage it
b) trying to extend while adding libraries/projects
c) finding the bugs that were added during a) / b) ...
Does this switch to bazel also means that angular.json would be obsolete?
I tried bazel on my projects (small-ish) and it felt that angular without bazel built faster than with bazel, but it could be just some weird issues (on a mac)
No, the
angular.json
is still mandatory. You have to keep it!Actually, when you run
ng add @angular/bazel
, we update yourangular.json
to automatically switch from the older builder to the new Bazel builder, so you can keep running the usualng build
command. See:github.com/bazelbuild/rules_nodejs...
Thank you very much! Excellent article!
Experience taught me to be skeptic when a new build tool is around the corner as it almost always means some extra work you're not spending on the tasks you originally intended. I can't count the hours I sunk into them. Nevertheless I'm looking forward to faster build times :)
What we usually tell developers is that if your Angular application is building fine and you are happy with the build (and tests) speed/perfs, you don't have to switch to Bazel. Also, in most cases, you won't need to learn about Bazel since all common tasks would be handled automatically for you. However, knowing Bazel basics might help, but this is not mandatory.
So, how to implemnts environtments dev, stag and prod on angular after add bazel. Before that, I'm used fileReplacement configuration on angular.json to change environment. How about bazel?
This is a good article...
I used Bazel with Angular application but facing many problems with the angular library. can you tell us how we gonna use Bazel with angular library
.
Angular Bazel configuration exemples
Thanks for replay I have solved my problems.
Please, would you tell me why this command isn't working,
bazel query --output=graph ... | dot -Tpng > graph.png
I can't get this part: dot -Tpng it's unknown for my mac.
You need graphviz installed in order to run the
dot
command.Thanks for noticing it, I'll add this information.
Yes, that was the problem, i also realized the problem and i just install it.. it works, so it's used maybe for building the graph png image.
Thank you very much.