| load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test", "nodejs_binary", "nodejs_test", "npm_package_bin") | |
| load("@npm//typescript:index.bzl", "tsc") | |
| load("//:index.bzl", "js_library") | |
| load("//packages/jasmine:index.bzl", "jasmine_node_test") | |
| load("//third_party/github.com/bazelbuild/bazel-skylib:rules/copy_file.bzl", "copy_file") | |
| load("@bazel_skylib//rules:write_file.bzl", "write_file") | |
| load(":npm_package_bin_test.bzl", "npm_package_bin_test_suite") | |
| # You can have a nodejs_binary with no node_modules attribute | |
| # and no fine grained deps | |
| nodejs_binary( | |
| name = "no_deps", | |
| data = ["no-deps.js"], | |
| entry_point = ":no-deps.js", | |
| ) | |
| # You can have a nodejs_binary with a //:node_modules in deps | |
| nodejs_binary( | |
| name = "has_deps_legacy", | |
| data = [ | |
| "has-deps.js", | |
| "@fine_grained_deps_yarn//:node_modules", | |
| ], | |
| entry_point = ":has-deps.js", | |
| ) | |
| # You can have a nodejs_binary with no node_modules attribute | |
| # and fine grained deps | |
| nodejs_binary( | |
| name = "has_deps", | |
| data = [ | |
| "has-deps.js", | |
| "@fine_grained_deps_yarn//typescript", | |
| ], | |
| entry_point = ":has-deps.js", | |
| ) | |
| # You can have a nodejs_binary with both a //:node_modules and | |
| # and fine grained deps so long as they come from the same root | |
| nodejs_binary( | |
| name = "has_deps_hybrid", | |
| data = [ | |
| "has-deps.js", | |
| "@fine_grained_deps_yarn//:node_modules", | |
| "@fine_grained_deps_yarn//typescript", | |
| ], | |
| entry_point = ":has-deps.js", | |
| ) | |
| filegroup( | |
| name = "entry_file", | |
| srcs = ["no-deps.js"], | |
| ) | |
| nodejs_binary( | |
| name = "has_entry_file", | |
| entry_point = ":entry_file", | |
| ) | |
| js_library( | |
| name = "module_name_lib", | |
| package_name = "build_bazel_rules_nodejs/internal/node/test", | |
| srcs = ["module-name.js"], | |
| ) | |
| nodejs_binary( | |
| name = "module_name_test", | |
| data = [":module_name_lib"], | |
| entry_point = ":module-name.js", | |
| ) | |
| jasmine_node_test( | |
| name = "env_test", | |
| srcs = [":env.spec.js"], | |
| data = [ | |
| ":dump_build_env.json", | |
| ":dump_build_env_alt.json", | |
| ":dump_build_env_attr_json", | |
| ], | |
| ) | |
| nodejs_test( | |
| name = "define_var", | |
| configuration_env_vars = [ | |
| "SOME_TEST_ENV", | |
| "SOME_OTHER_ENV", | |
| ], | |
| entry_point = ":define.spec.js", | |
| ) | |
| nodejs_test( | |
| name = "mode_resolution_test", | |
| data = [ | |
| "//internal/node/test/lib1", | |
| "//internal/node/test/lib2", | |
| "@npm//node_resolve_index", | |
| "@npm//node_resolve_index_2", | |
| "@npm//node_resolve_index_3", | |
| "@npm//node_resolve_index_4", | |
| "@npm//node_resolve_main", | |
| "@npm//node_resolve_main_2", | |
| "@npm//node_resolve_nested_main", | |
| ], | |
| entry_point = ":module_resolution.spec.js", | |
| # this is a test for the patched module resolver | |
| templated_args = ["--bazel_patch_module_resolver"], | |
| ) | |
| nodejs_test( | |
| name = "data_resolution_test", | |
| data = [ | |
| "data/data.json", | |
| ], | |
| entry_point = ":data_resolution.spec.js", | |
| ) | |
| nodejs_test( | |
| name = "bootstrap_legacy_location_test", | |
| data = [ | |
| "bootstrap.js", | |
| "@npm//tmp", | |
| ], | |
| entry_point = ":bootstrap.spec.js", | |
| # Also ensure that legacy "$(rlocation $(...))" usage is preserved so that users | |
| # don't have to upgrade to "$$(rlocation $(...))" | |
| templated_args = ["--node_options=--require=$(rlocation $(location :bootstrap.js))"], | |
| ) | |
| nodejs_test( | |
| name = "bootstrap_patch_test", | |
| data = ["bootstrap_with_patch.js"], | |
| entry_point = ":bootstrap.spec.js", | |
| templated_args = ["--node_options=--require=$$(rlocation $(location :bootstrap_with_patch.js))"], | |
| ) | |
| # Special case when $(location) is for a root file | |
| nodejs_test( | |
| name = "bootstrap_legacy_location_root_test", | |
| data = ["//:bootstrap.js"], | |
| entry_point = ":bootstrap.spec.js", | |
| templated_args = ["--node_options=--require=$$(rlocation $(location //:bootstrap.js))"], | |
| ) | |
| nodejs_test( | |
| name = "bootstraps_legacy_location_test", | |
| data = [ | |
| "bootstrap1.js", | |
| "bootstrap2.js", | |
| ], | |
| entry_point = ":bootstraps.spec.js", | |
| templated_args = [ | |
| "--node_options=--require=$$(rlocation $(location :bootstrap1.js))", | |
| "--node_options=--require=$$(rlocation $(location :bootstrap2.js))", | |
| ], | |
| ) | |
| nodejs_test( | |
| name = "bootstrap_rootpath_test", | |
| data = [ | |
| "bootstrap.js", | |
| "@npm//tmp", | |
| ], | |
| entry_point = ":bootstrap.spec.js", | |
| templated_args = ["--node_options=--require=$$(rlocation $(rootpath :bootstrap.js))"], | |
| ) | |
| # Special case when $(rootpath) is for a root file | |
| nodejs_test( | |
| name = "bootstrap_rootpath_root_test", | |
| data = ["//:bootstrap.js"], | |
| entry_point = ":bootstrap.spec.js", | |
| templated_args = ["--node_options=--require=$$(rlocation $(rootpath //:bootstrap.js))"], | |
| ) | |
| nodejs_test( | |
| name = "bootstraps_rootpath_test", | |
| data = [ | |
| "bootstrap1.js", | |
| "bootstrap2.js", | |
| ], | |
| entry_point = ":bootstraps.spec.js", | |
| templated_args = [ | |
| "--node_options=--require=$$(rlocation $(rootpath :bootstrap1.js))", | |
| "--node_options=--require=$$(rlocation $(rootpath :bootstrap2.js))", | |
| ], | |
| ) | |
| # Also test resolution from built files. | |
| copy_file( | |
| name = "module_resolution_lib", | |
| src = "module_resolution.spec.js", | |
| out = "module_resolution_built.spec.js", | |
| ) | |
| copy_file( | |
| name = "data_resolution_lib", | |
| src = "data_resolution.spec.js", | |
| out = "data_resolution_built.spec.js", | |
| ) | |
| # This rule creates a file that alphabetically comes before any source file in this | |
| # package. This genfile can be then set up as runfile to verify that the "loader.cjs" | |
| # properly determines the local workspace path without incorrectly using the genfile as base | |
| # for the local workspace path. See: https://github.com/bazelbuild/rules_nodejs/issues/352 | |
| write_file( | |
| name = "genfile-runfile", | |
| out = "#LEADING.txt", | |
| ) | |
| nodejs_test( | |
| name = "mode_resolution_built_test", | |
| data = [ | |
| "//internal/node/test/lib1", | |
| "//internal/node/test/lib2", | |
| "@npm//node_resolve_index", | |
| "@npm//node_resolve_index_2", | |
| "@npm//node_resolve_index_3", | |
| "@npm//node_resolve_index_4", | |
| "@npm//node_resolve_main", | |
| "@npm//node_resolve_main_2", | |
| "@npm//node_resolve_nested_main", | |
| ], | |
| entry_point = ":module_resolution_built.spec.js", | |
| # TODO: passes locally without this flag but fails on CircleCI | |
| templated_args = ["--bazel_patch_module_resolver"], | |
| ) | |
| nodejs_test( | |
| name = "data_resolution_built_test", | |
| data = [ | |
| "data/data.json", | |
| ":genfile-runfile", | |
| ], | |
| entry_point = ":data_resolution_built.spec.js", | |
| # TODO: fails on Windows without this flag | |
| templated_args = ["--bazel_patch_module_resolver"], | |
| ) | |
| npm_package_bin( | |
| name = "run_terser", | |
| outs = ["minified.js"], | |
| args = [ | |
| "$(execpath terser_input.js)", | |
| "--output", | |
| "$@", | |
| ], | |
| data = ["terser_input.js"], | |
| package = "terser", | |
| ) | |
| # captures stdout of terser_input.js to minified.stdout.js (note args do not include --output flag) | |
| npm_package_bin( | |
| name = "run_terser_stdout", | |
| args = [ | |
| "$(execpath terser_input.js)", | |
| ], | |
| data = ["terser_input.js"], | |
| package = "terser", | |
| stdout = "minified.stdout.js", | |
| ) | |
| npm_package_bin_test_suite() | |
| generated_file_test( | |
| name = "stdout_output_test", | |
| src = "stdout_output_test.golden", | |
| generated = ":minified.stdout.js", | |
| ) | |
| # target that shouldn't print anything on stdout nor stderr when built even through the binary does | |
| npm_package_bin( | |
| name = "loud_binary", | |
| args = [ | |
| "$(execpath terser_input_with_diagnostics.js)", | |
| "--compress", | |
| "--verbose", | |
| "--warn", | |
| ], | |
| data = ["terser_input_with_diagnostics.js"], | |
| output_dir = True, | |
| package = "terser", | |
| silent_on_success = True, | |
| ) | |
| # capture stderr to diagnostics.out, then analyze it in terser_diagnostics_stats printing some stats | |
| # stdout is captured into greeter.min.js (again, without the --output $@ flags) | |
| # the exit code is also capture to a file with exit_code_out, allowing downstream actions to read it | |
| npm_package_bin( | |
| name = "diagnostics_producing_bin", | |
| args = [ | |
| "$(execpath terser_input_with_diagnostics.js)", | |
| "--compress", | |
| "--verbose", | |
| "--warn", | |
| ], | |
| data = ["terser_input_with_diagnostics.js"], | |
| exit_code_out = "exit.code", | |
| package = "terser", | |
| stderr = "diagnostics.out", | |
| stdout = "greeter.min.js", | |
| ) | |
| nodejs_binary( | |
| name = "terser_diagnostics_stats", | |
| data = [ | |
| "diagnostics_producing_bin", | |
| "terser_diagnostics_stats.js", | |
| ], | |
| entry_point = "terser_diagnostics_stats.js", | |
| ) | |
| # When we build with --define=VERBOSE_LOGS=1 there is some extra stuff printed to stderr | |
| # We don't care to assert about that, and it has machine-local paths so we can't assert | |
| # on the exact content either. | |
| genrule( | |
| name = "scrub_verbose_logs_stderr", | |
| srcs = [":diagnostics.out"], | |
| outs = [":diagnostics.scrubbed.out"], | |
| cmd = "grep -v 'bazel node patches enabled' $< > $@", | |
| ) | |
| generated_file_test( | |
| name = "stderr_output_test", | |
| src = "stderr_output_test.golden", | |
| generated = ":diagnostics.scrubbed.out", | |
| ) | |
| generated_file_test( | |
| name = "exit_code_test", | |
| src = "exit_code_test.golden", | |
| generated = ":exit.code", | |
| ) | |
| nodejs_binary( | |
| name = "copy_to_directory", | |
| entry_point = "copy_to_directory.js", | |
| ) | |
| npm_package_bin( | |
| name = "dir_output", | |
| args = [ | |
| "--output-dir", | |
| "$(@D)", | |
| "$(execpath terser_input.js)", | |
| ], | |
| data = ["terser_input.js"], | |
| output_dir = True, | |
| tool = ":copy_to_directory", | |
| ) | |
| jasmine_node_test( | |
| name = "npm_package_bin_test", | |
| srcs = ["npm_package_bin.spec.js"], | |
| data = [ | |
| "dir_output", | |
| "minified.js", | |
| ], | |
| ) | |
| nodejs_binary( | |
| name = "expand_variables", | |
| entry_point = "expand_variables.js", | |
| ) | |
| npm_package_bin( | |
| name = "expand_variables_ouput", | |
| outs = ["expand_variables.out"], | |
| args = [ | |
| "$@", | |
| "$(COMPILATION_MODE)", | |
| "$(TARGET_CPU)", | |
| "$(BINDIR)", | |
| "$(SOME_TEST_ENV)", | |
| "somearg$$", | |
| "some0arg", | |
| ], | |
| env = { | |
| "OUTFILE": "$@", | |
| "COMPLATION_MODE": "$(COMPILATION_MODE)", | |
| "TARGET_CPU": "$(TARGET_CPU)", | |
| "BINDIR": "$(BINDIR)", | |
| "SOME_TEST_ENV": "$(SOME_TEST_ENV)", | |
| "SOMEARG$$": "somearg$$", | |
| "SOME0ARG": "some0arg", | |
| }, | |
| tool = ":expand_variables", | |
| ) | |
| jasmine_node_test( | |
| name = "expand_variables_test", | |
| srcs = [":expand_variables.spec.js"], | |
| data = [":expand_variables.out"], | |
| templated_args = [ | |
| "$(rootpath :expand_variables.out)", | |
| "$(execpath :expand_variables.out)", | |
| "$(COMPILATION_MODE)", | |
| "$(TARGET_CPU)", | |
| "$(BINDIR)", | |
| "$(SOME_TEST_ENV)", | |
| # Should preserve lone $ in templated_args | |
| "somearg$", | |
| "some$#arg", | |
| ], | |
| ) | |
| nodejs_binary( | |
| name = "dump_build_env_attr", | |
| data = ["dump_build_env.js"], | |
| entry_point = "dump_build_env.js", | |
| env = { | |
| "LOC": "$(location :dump_build_env.js)", | |
| "SOME_TEST_ENV": "$(SOME_TEST_ENV)", | |
| }, | |
| ) | |
| nodejs_binary( | |
| name = "dump_build_env", | |
| entry_point = "dump_build_env.js", | |
| ) | |
| nodejs_binary( | |
| name = "dump_build_env_alt", | |
| data = ["@npm//tmp"], | |
| entry_point = "dump_build_env.js", | |
| ) | |
| npm_package_bin( | |
| name = "dump_build_env_json", | |
| outs = ["dump_build_env.json"], | |
| args = ["$@"], | |
| tool = ":dump_build_env", | |
| ) | |
| npm_package_bin( | |
| name = "dump_build_env_alt_json", | |
| outs = ["dump_build_env_alt.json"], | |
| args = ["$@"], | |
| tool = ":dump_build_env_alt", | |
| ) | |
| npm_package_bin( | |
| name = "dump_build_env_attr_json", | |
| outs = ["dump_build_env_attr.json"], | |
| args = ["$@"], | |
| env = { | |
| "FOO": "BAR", | |
| }, | |
| tool = ":dump_build_env_attr", | |
| ) | |
| nodejs_binary( | |
| name = "test_runfiles_helper", | |
| data = [":test_runfiles_helper.golden"], | |
| entry_point = "test_runfiles_helper.js", | |
| ) | |
| npm_package_bin( | |
| name = "test_runfiles_helper_ouput", | |
| outs = ["test_runfiles_helper.out"], | |
| args = ["$@"], | |
| tool = ":test_runfiles_helper", | |
| ) | |
| generated_file_test( | |
| name = "test_runfiles_helper_test", | |
| src = "test_runfiles_helper.golden", | |
| generated = ":test_runfiles_helper.out", | |
| ) | |
| nodejs_test( | |
| name = "fail_test", | |
| entry_point = "fail.spec.js", | |
| expected_exit_code = 55, | |
| ) | |
| nodejs_test( | |
| name = "fail_bootstrap_fail_test", | |
| data = ["bootstrap_fail.js"], | |
| entry_point = "fail.spec.js", | |
| expected_exit_code = 33, | |
| templated_args = ["--node_options=--require=$$(rlocation $(location :bootstrap_fail.js))"], | |
| ) | |
| nodejs_test( | |
| name = "fail_bootstrap_test", | |
| data = [ | |
| "bootstrap.js", | |
| "@npm//tmp", | |
| ], | |
| entry_point = "fail.spec.js", | |
| expected_exit_code = 55, | |
| templated_args = ["--node_options=--require=$$(rlocation $(location :bootstrap.js))"], | |
| ) | |
| nodejs_test( | |
| name = "fail_bootstrap_with_patch_test", | |
| data = ["bootstrap_with_patch.js"], | |
| entry_point = "fail.spec.js", | |
| expected_exit_code = 55, | |
| templated_args = ["--node_options=--require=$$(rlocation $(location :bootstrap_with_patch.js))"], | |
| ) | |
| nodejs_test( | |
| name = "binary_with_no_arguments", | |
| data = ["empty_args_fail.js"], | |
| entry_point = "empty_args_fail.js", | |
| expected_exit_code = 0, | |
| ) | |
| tsc( | |
| name = "main_lib", | |
| outs = [ | |
| "main.js", | |
| ], | |
| args = [ | |
| "-p", | |
| "$(execpath tsconfig.json)", | |
| "--outDir", | |
| # $(RULEDIR) is a shorthand for the dist/bin directory where Bazel requires we write outputs | |
| "$(RULEDIR)", | |
| ], | |
| data = [ | |
| "main.ts", | |
| "tsconfig.json", | |
| ], | |
| ) | |
| nodejs_test( | |
| name = "main_test", | |
| data = [":main_lib"], | |
| entry_point = ":main.js", | |
| ) | |
| # Targets that can help with debugging and ensuring that node versions can be specified | |
| # for nodejs_binary and nodejs_test | |
| # Used in nodejs_bianry later to help see which version of node is run | |
| write_file( | |
| name = "binary_version", | |
| out = "binary_version.js", | |
| content = ["console.log(process.version)"], | |
| ) | |
| nodejs_binary( | |
| name = "main_default_toolchain", | |
| entry_point = "binary_version.js", | |
| ) | |
| nodejs_binary( | |
| name = "main_toolchain_15", | |
| entry_point = "binary_version.js", | |
| # using the select statement will download toolchains for all three platforms | |
| # you can also just provide an individual toolchain if you don't want to download them all | |
| toolchain = select({ | |
| "@bazel_tools//src/conditions:linux_x86_64": "@node15_linux_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:darwin": "@node15_darwin_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:windows": "@node15_windows_amd64//:node_toolchain", | |
| }), | |
| ) | |
| nodejs_binary( | |
| name = "main_toolchain_16", | |
| entry_point = "binary_version.js", | |
| # using the select statement will download toolchains for all three platforms | |
| # you can also just provide an individual toolchain if you don't want to download them all | |
| toolchain = select({ | |
| "@bazel_tools//src/conditions:linux_x86_64": "@node16_linux_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:darwin": "@node16_darwin_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:windows": "@node16_windows_amd64//:node_toolchain", | |
| }), | |
| ) | |
| nodejs_test( | |
| name = "main_default_toolchain_test", | |
| entry_point = "toolchain_test_default.js", | |
| ) | |
| nodejs_test( | |
| name = "main_toolchain_15_test", | |
| entry_point = "toolchain_test_v15.14.0.js", | |
| # using the select statement will download toolchains for all three platforms | |
| # you can also just provide an individual toolchain if you don't want to download them all | |
| toolchain = select({ | |
| "@bazel_tools//src/conditions:linux_x86_64": "@node15_linux_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:darwin": "@node15_darwin_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:windows": "@node15_windows_amd64//:node_toolchain", | |
| }), | |
| ) | |
| nodejs_test( | |
| name = "main_toolchain_16_test", | |
| entry_point = "toolchain_test_v16.js", | |
| # using the select statement will download toolchains for all three platforms | |
| # you can also just provide an individual toolchain if you don't want to download them all | |
| toolchain = select({ | |
| "@bazel_tools//src/conditions:linux_x86_64": "@node16_linux_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:darwin": "@node16_darwin_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:windows": "@node16_windows_amd64//:node_toolchain", | |
| }), | |
| ) | |
| # these rules create different targets for each toolchain that is supplied in the list for toolchains | |
| # this makes it easy to build or test against multiple versions of a toolchain at the same time with less duplicate work | |
| # this will create 2 nodejs_binary targets | |
| # bazel build //internal/node/test:main_multiple_loop_node16 | |
| # bazel build //internal/node/test:main_multiple_loop_node15 | |
| # the numbers are based on the order that the toolchains are passed to the rule | |
| [ | |
| nodejs_binary( | |
| name = "main_multiple_loop_" + id, | |
| entry_point = "binary_version.js", | |
| toolchain = tc, | |
| ) | |
| for id, tc in zip( | |
| [ | |
| "node16", | |
| "node15", | |
| ], | |
| [ | |
| # using the select statement will download toolchains for all platforms | |
| # you can also just provide an individual toolchain if you don't want to download them all | |
| select({ | |
| "@bazel_tools//src/conditions:linux_x86_64": "@node16_linux_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:darwin": "@node16_darwin_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:windows": "@node16_windows_amd64//:node_toolchain", | |
| }), | |
| select({ | |
| "@bazel_tools//src/conditions:linux_x86_64": "@node15_linux_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:darwin": "@node15_darwin_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:windows": "@node15_windows_amd64//:node_toolchain", | |
| }), | |
| ], | |
| ) | |
| ] | |
| # this will create 2 test: | |
| # bazel test //internal/node/test:main_test_multiple_loop_node16 | |
| # bazel test //internal/node/test:main_test_multiple_loop_node15 | |
| # the numbers are based on the order that the toolchains are passed to the rule | |
| [ | |
| nodejs_test( | |
| name = "main_test_multiple_loop_" + id, | |
| data = [ | |
| "data/data.json", | |
| ], | |
| entry_point = ":data_resolution.spec.js", | |
| toolchain = tc, | |
| ) | |
| for id, tc in zip( | |
| [ | |
| "node16", | |
| "node15", | |
| ], | |
| [ | |
| # using the select statement will download toolchains for all platforms | |
| # you can also just provide an individual toolchain if you don't want to download them all | |
| select({ | |
| "@bazel_tools//src/conditions:linux_x86_64": "@node16_linux_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:darwin": "@node16_darwin_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:windows": "@node16_windows_amd64//:node_toolchain", | |
| }), | |
| select({ | |
| "@bazel_tools//src/conditions:linux_x86_64": "@node15_linux_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:darwin": "@node15_darwin_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:windows": "@node15_windows_amd64//:node_toolchain", | |
| }), | |
| ], | |
| ) | |
| ] | |
| # this will create 2 test: | |
| # bazel test //internal/node/test:main_test_multiple_version_node16 | |
| # bazel test //internal/node/test:main_test_multiple_version_node15 | |
| # the numbers are based on the order that the toolchains are passed to the rule | |
| [ | |
| nodejs_test( | |
| name = "main_test_multiple_version_" + id, | |
| entry_point = entry, | |
| toolchain = tc, | |
| ) | |
| for id, entry, tc in zip( | |
| [ | |
| "node16", | |
| "node15", | |
| ], | |
| [ | |
| "toolchain_test_v16.js", | |
| "toolchain_test_v15.14.0.js", | |
| ], | |
| [ | |
| # using the select statement will download toolchains for all platforms | |
| # you can also just provide an individual toolchain if you don't want to download them all | |
| select({ | |
| "@bazel_tools//src/conditions:linux_x86_64": "@node16_linux_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:darwin": "@node16_darwin_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:windows": "@node16_windows_amd64//:node_toolchain", | |
| }), | |
| select({ | |
| "@bazel_tools//src/conditions:linux_x86_64": "@node15_linux_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:darwin": "@node15_darwin_amd64//:node_toolchain", | |
| "@bazel_tools//src/conditions:windows": "@node15_windows_amd64//:node_toolchain", | |
| }), | |
| ], | |
| ) | |
| ] |