github.com/mmrath/gobase@v0.0.1/.bazelrc (about)

     1  # Common Bazel settings for JavaScript/NodeJS workspaces
     2  # This rc file is automatically discovered when Bazel is run in this workspace,
     3  # see https://docs.bazel.build/versions/master/guide.html#bazelrc
     4  #
     5  # The full list of Bazel options: https://docs.bazel.build/versions/master/command-line-reference.html
     6  
     7  # Cache action outputs on disk so they persist across output_base and bazel shutdown (eg. changing branches)
     8  build --disk_cache=~/.cache/bazel-disk-cache
     9  
    10  # Bazel will create symlinks from the workspace directory to output artifacts.
    11  # Build results will be placed in a directory called "dist/bin"
    12  # Other directories will be created like "dist/testlogs"
    13  # Be aware that this will still create a bazel-out symlink in
    14  # your project directory, which you must exclude from version control and your
    15  # editor's search path.
    16  build --symlink_prefix=dist/
    17  # To disable the symlinks altogether (including bazel-out) you can use
    18  # build --symlink_prefix=/
    19  # however this makes it harder to find outputs.
    20  
    21  # Specifies desired output mode for running tests.
    22  # Valid values are
    23  #   'summary' to output only test status summary
    24  #   'errors' to also print test logs for failed tests
    25  #   'all' to print logs for all tests
    26  #   'streamed' to output logs for all tests in real time
    27  #     (this will force tests to be executed locally one at a time regardless of --test_strategy value).
    28  test --test_output=errors
    29  
    30  # Support for debugging NodeJS tests
    31  # Add the Bazel option `--config=debug` to enable this
    32  # --test_output=streamed
    33  #     Stream stdout/stderr output from each test in real-time.
    34  #     See https://docs.bazel.build/versions/master/user-manual.html#flag--test_output for more details.
    35  # --test_strategy=exclusive
    36  #     Run one test at a time.
    37  # --test_timeout=9999
    38  #     Prevent long running tests from timing out
    39  #     See https://docs.bazel.build/versions/master/user-manual.html#flag--test_timeout for more details.
    40  # --nocache_test_results
    41  #     Always run tests
    42  # --node_options=--inspect-brk
    43  #     Pass the --inspect-brk option to all tests which enables the node inspector agent.
    44  #     See https://nodejs.org/de/docs/guides/debugging-getting-started/#command-line-options for more details.
    45  # --define=VERBOSE_LOGS=1
    46  #     Rules will output verbose logs if the VERBOSE_LOGS environment variable is set. `VERBOSE_LOGS` will be passed to
    47  #     `nodejs_binary` and `nodejs_test` via the default value of the `default_env_vars` attribute of those rules.
    48  # --compilation_mode=dbg
    49  #     Rules may change their build outputs if the compilation mode is set to dbg. For example,
    50  #     mininfiers such as terser may make their output more human readable when this is set. `COMPILATION_MODE` will be passed to
    51  #     `nodejs_binary` and `nodejs_test` via the default value of the `default_env_vars` attribute of those rules.
    52  #     See https://docs.bazel.build/versions/master/user-manual.html#flag--compilation_mode for more details.
    53  test:debug --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results --define=VERBOSE_LOGS=1
    54  # Use bazel run with `--config=debug` to turn on the NodeJS inspector agent.
    55  # The node process will break before user code starts and wait for the debugger to connect.
    56  run:debug --define=VERBOSE_LOGS=1 -- --node_options=--inspect-brk
    57  # The following option will change the build output of certain rules such as terser and may not be desirable in all cases
    58  build:debug --compilation_mode=dbg
    59  
    60  # Turn off legacy external runfiles
    61  # This prevents accidentally depending on this feature, which Bazel will remove.
    62  build --nolegacy_external_runfiles
    63  
    64  # Turn on the "Managed Directories" feature.
    65  # This allows Bazel to share the same node_modules directory with other tools
    66  # NB: this option was introduced in Bazel 0.26
    67  # See https://docs.bazel.build/versions/master/command-line-reference.html#flag--experimental_allow_incremental_repository_updates
    68  common --experimental_allow_incremental_repository_updates
    69  
    70  # Turn on --incompatible_strict_action_env which was on by default
    71  # in Bazel 0.21.0 but turned off again in 0.22.0. Follow
    72  # https://github.com/bazelbuild/bazel/issues/7026 for more details.
    73  # This flag is needed to so that the bazel cache is not invalidated
    74  # when running bazel via `yarn bazel`.
    75  # See https://github.com/angular/angular/issues/27514.
    76  build --incompatible_strict_action_env
    77  run --incompatible_strict_action_env
    78  
    79  # Load any settings specific to the current user.
    80  # .bazelrc.user should appear in .gitignore so that settings are not shared with team members
    81  # This needs to be last statement in this
    82  # config, as the user configuration should be able to overwrite flags from this file.
    83  # See https://docs.bazel.build/versions/master/best-practices.html#bazelrc
    84  # (Note that we use .bazelrc.user so the file appears next to .bazelrc in directory listing,
    85  # rather than user.bazelrc as suggested in the Bazel docs)
    86  try-import %workspace%/.bazelrc.user