Search code examples
angularbazel

How can I set bazel option --output_user_root for Angular CLI


My user root contains a space in it so I get the following error when trying to run ng serve with bazel enabled:

WARNING: Output user root "C:/Users/Simon Weaver/_bazel_Simon Weaver" contains a space. This will probably break the build. You should set a different --output_user_root.

I just cannot find where to put this option - everywhere I've tried - such as angular.json file under options, or directly on the command line - either complains or fails.


Solution

  • Create (or modify) the .bazelrc file in your project root with the following content:

    startup --output_user_root=<path/to/new/root>
    

    This is equivalent to running $ bazel --output_user_root=<path/to/new/root> build ...

    See this page for more information on .bazelrc files.