diff --git a/e2e/nodejs_image/BUILD.bazel b/e2e/nodejs_image/BUILD.bazel index c2f9c6b35e..88ce171dde 100644 --- a/e2e/nodejs_image/BUILD.bazel +++ b/e2e/nodejs_image/BUILD.bazel @@ -9,8 +9,6 @@ nodejs_binary( "@npm//date-fns", ], entry_point = "main.js", - # Turn off require() monkey patches so linker is required to run inside docker container - templated_args = ["--nobazel_patch_module_resolver"], ) # bazel run --platforms=@build_bazel_rules_nodejs//toolchains/node:linux_amd64 //:nodejs_image diff --git a/examples/nestjs/src/BUILD.bazel b/examples/nestjs/src/BUILD.bazel index 28e27272a8..34027a69ad 100644 --- a/examples/nestjs/src/BUILD.bazel +++ b/examples/nestjs/src/BUILD.bazel @@ -61,7 +61,6 @@ nodejs_binary( "@npm//minimist", ], entry_point = ":main.ts", - templated_args = ["--nobazel_patch_module_resolver"], ) jasmine_node_test( diff --git a/examples/user_managed_deps/BUILD.bazel b/examples/user_managed_deps/BUILD.bazel index 808b886076..e5c8b83223 100644 --- a/examples/user_managed_deps/BUILD.bazel +++ b/examples/user_managed_deps/BUILD.bazel @@ -43,6 +43,7 @@ jasmine_node_test( srcs = glob(["*.spec.js"]), node_modules = "//:node_modules", tags = ["no-local-jasmine-deps"], + templated_args = ["--bazel_patch_module_resolver"], deps = [ ":decrement", ":program", diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 3933063d21..6c879318fb 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -32,7 +32,10 @@ nodejs_test( "//:.bazelversion", ], entry_point = ":check_bazel_version.js", - templated_args = [BAZEL_VERSION], + templated_args = [ + "--bazel_patch_module_resolver", + BAZEL_VERSION, + ], ) # Detect if the build is running under --stamp diff --git a/internal/bazel_integration_test/BUILD.bazel b/internal/bazel_integration_test/BUILD.bazel index bbc085ec1d..0450d83812 100644 --- a/internal/bazel_integration_test/BUILD.bazel +++ b/internal/bazel_integration_test/BUILD.bazel @@ -22,7 +22,10 @@ nodejs_binary( configuration_env_vars = ["BAZEL_INTEGRATION_TEST_DEBUG"], data = ["@npm//tmp"], entry_point = ":test_runner.js", - templated_args = ["--node_options=--max-old-space-size=1024"], + templated_args = [ + "--bazel_patch_module_resolver", + "--node_options=--max-old-space-size=1024", + ], ) filegroup( diff --git a/internal/linker/test/local/BUILD.bazel b/internal/linker/test/local/BUILD.bazel index 27712aacf6..041d7b4194 100644 --- a/internal/linker/test/local/BUILD.bazel +++ b/internal/linker/test/local/BUILD.bazel @@ -4,6 +4,5 @@ jasmine_node_test( name = "test", srcs = ["test.js"], tags = ["local"], - templated_args = ["--nobazel_patch_module_resolver"], deps = ["//internal/linker/test/local/fit"], ) diff --git a/internal/linker/test/workspace_link/BUILD.bazel b/internal/linker/test/workspace_link/BUILD.bazel index 3dd30cd4e5..560829fd3c 100644 --- a/internal/linker/test/workspace_link/BUILD.bazel +++ b/internal/linker/test/workspace_link/BUILD.bazel @@ -4,7 +4,6 @@ jasmine_node_test( name = "test", srcs = ["test.js"], link_workspace_root = True, - templated_args = ["--nobazel_patch_module_resolver"], deps = [ "//internal/linker/test/workspace_link/bar", "//internal/linker/test/workspace_link/foo", diff --git a/internal/node/launcher.sh b/internal/node/launcher.sh index 10efb6c4e6..49756bfbb4 100644 --- a/internal/node/launcher.sh +++ b/internal/node/launcher.sh @@ -179,8 +179,7 @@ EXIT_CODE_CAPTURE="" RUN_LINKER=true NODE_PATCHES=true -# TODO(alex): change the default to false -PATCH_REQUIRE=true +PATCH_REQUIRE=false for ARG in ${ALL_ARGS[@]+"${ALL_ARGS[@]}"}; do case "$ARG" in # Supply custom linker arguments for first-party dependencies @@ -193,10 +192,9 @@ for ARG in ${ALL_ARGS[@]+"${ALL_ARGS[@]}"}; do --bazel_capture_exit_code=*) EXIT_CODE_CAPTURE="${ARG#--bazel_capture_exit_code=}" ;; # Disable the node_loader.js monkey patches for require() # Note that this means you need an explicit runfiles helper library + # This flag is now a no-op since the default is also false --nobazel_patch_module_resolver) PATCH_REQUIRE=false ;; # Enable the node_loader.js monkey patches for require() - # Currently a no-op, but specifying this makes the behavior unchanged when we update - # the default for PATCH_REQUIRE above --bazel_patch_module_resolver) PATCH_REQUIRE=true ;; # Disable the --require node-patches (undocumented and unused; only here as an escape value) --nobazel_node_patches) NODE_PATCHES=false ;; diff --git a/internal/node/test/BUILD.bazel b/internal/node/test/BUILD.bazel index 6c1d0398a3..5cbd468a7b 100644 --- a/internal/node/test/BUILD.bazel +++ b/internal/node/test/BUILD.bazel @@ -22,6 +22,7 @@ nodejs_binary( data = ["has-deps.js"], entry_point = ":has-deps.js", node_modules = "@fine_grained_deps_yarn//:node_modules", + templated_args = ["--bazel_patch_module_resolver"], ) # You can have a nodejs_binary with no node_modules attribute @@ -101,6 +102,7 @@ nodejs_test( "@npm//node_resolve_nested_main", ], entry_point = ":module_resolution.spec.js", + templated_args = ["--bazel_patch_module_resolver"], ) nodejs_test( @@ -218,6 +220,7 @@ nodejs_test( "@npm//node_resolve_nested_main", ], entry_point = ":module_resolution_built.spec.js", + templated_args = ["--bazel_patch_module_resolver"], ) nodejs_test( @@ -331,14 +334,6 @@ jasmine_node_test( "dir_output", "minified.js", ], - # Turn on the linker & turn off require patches so that the external workspace jasmine_node_test - # entry point npm/@bazel/jasmine/jasmine_runner.js's require('@bazel/jasmine') is exercised without - # require patches. - templated_args = select({ - # TODO: fix this linker assertion on Windows - "@bazel_tools//src/conditions:host_windows": [], - "//conditions:default": ["--nobazel_patch_module_resolver"], - }), ) [nodejs_toolchain_test( @@ -491,5 +486,4 @@ nodejs_test( name = "main_test", data = [":main_lib"], entry_point = ":main.js", - templated_args = ["--nobazel_patch_module_resolver"], ) diff --git a/internal/npm_install/BUILD.bazel b/internal/npm_install/BUILD.bazel index f138dc7c74..a18ed85067 100644 --- a/internal/npm_install/BUILD.bazel +++ b/internal/npm_install/BUILD.bazel @@ -56,5 +56,6 @@ nodejs_binary( "//third_party/npm/node_modules/named-amd", ], entry_point = ":browserify-wrapped.js", + templated_args = ["--bazel_patch_module_resolver"], visibility = ["//visibility:public"], ) diff --git a/internal/npm_install/generate_build_file.ts b/internal/npm_install/generate_build_file.ts index e81991f07a..c9684aea46 100644 --- a/internal/npm_install/generate_build_file.ts +++ b/internal/npm_install/generate_build_file.ts @@ -1108,8 +1108,7 @@ export function printPackageBin(pkg: Dep) { nodejs_binary( name = "${name}", entry_point = "//:node_modules/${pkg._dir}/${path}", - data = [${data.map(p => `"${p}"`).join(', ')}], - templated_args = ["--nobazel_patch_module_resolver"],${additionalAttributes(pkg, name)} + data = [${data.map(p => `"${p}"`).join(', ')}],${additionalAttributes(pkg, name)} ) `; } @@ -1144,8 +1143,7 @@ def ${name.replace(/-/g, '_')}(**kwargs): nodejs_binary( entry_point = "@${WORKSPACE}//:node_modules/${pkg._dir}/${path}", data = [${data.map(p => `"${p}"`).join(', ')}] + kwargs.pop("data", []), - templated_args = ["--nobazel_patch_module_resolver"] + kwargs.pop("templated_args", []),${ - additionalAttributes(pkg, name)} + templated_args = kwargs.pop("templated_args", []),${additionalAttributes(pkg, name)} **kwargs ) @@ -1154,8 +1152,7 @@ def ${name.replace(/-/g, '_')}_test(**kwargs): nodejs_test( entry_point = "@${WORKSPACE}//:node_modules/${pkg._dir}/${path}", data = [${data.map(p => `"${p}"`).join(', ')}] + kwargs.pop("data", []), - templated_args = ["--nobazel_patch_module_resolver"] + kwargs.pop("templated_args", []),${ - additionalAttributes(pkg, name)} + templated_args = kwargs.pop("templated_args", []),${additionalAttributes(pkg, name)} **kwargs ) `; diff --git a/internal/npm_install/index.js b/internal/npm_install/index.js index c0a025b923..4479119b28 100644 --- a/internal/npm_install/index.js +++ b/internal/npm_install/index.js @@ -673,8 +673,7 @@ function printPackageBin(pkg) { nodejs_binary( name = "${name}", entry_point = "//:node_modules/${pkg._dir}/${path}", - data = [${data.map(p => `"${p}"`).join(', ')}], - templated_args = ["--nobazel_patch_module_resolver"],${additionalAttributes(pkg, name)} + data = [${data.map(p => `"${p}"`).join(', ')}],${additionalAttributes(pkg, name)} ) `; } @@ -706,7 +705,7 @@ def ${name.replace(/-/g, '_')}(**kwargs): nodejs_binary( entry_point = "@${WORKSPACE}//:node_modules/${pkg._dir}/${path}", data = [${data.map(p => `"${p}"`).join(', ')}] + kwargs.pop("data", []), - templated_args = ["--nobazel_patch_module_resolver"] + kwargs.pop("templated_args", []),${additionalAttributes(pkg, name)} + templated_args = kwargs.pop("templated_args", []),${additionalAttributes(pkg, name)} **kwargs ) @@ -715,7 +714,7 @@ def ${name.replace(/-/g, '_')}_test(**kwargs): nodejs_test( entry_point = "@${WORKSPACE}//:node_modules/${pkg._dir}/${path}", data = [${data.map(p => `"${p}"`).join(', ')}] + kwargs.pop("data", []), - templated_args = ["--nobazel_patch_module_resolver"] + kwargs.pop("templated_args", []),${additionalAttributes(pkg, name)} + templated_args = kwargs.pop("templated_args", []),${additionalAttributes(pkg, name)} **kwargs ) `; diff --git a/internal/npm_install/test/BUILD.bazel b/internal/npm_install/test/BUILD.bazel index 286295f9f9..c152640244 100644 --- a/internal/npm_install/test/BUILD.bazel +++ b/internal/npm_install/test/BUILD.bazel @@ -18,6 +18,7 @@ jasmine_node_test( "@fine_grained_goldens//:golden_files", "@npm//unidiff", ], + templated_args = ["--bazel_patch_module_resolver"], ) nodejs_binary( @@ -81,6 +82,7 @@ jasmine_node_test( "//internal/npm_install:browserify-wrapped", "@npm//date-fns:date-fns.umd.js", ], + templated_args = ["--bazel_patch_module_resolver"], ) sh_test( diff --git a/internal/npm_install/test/golden/@gregmagolan/test-a/bin/BUILD.bazel.golden b/internal/npm_install/test/golden/@gregmagolan/test-a/bin/BUILD.bazel.golden index 92d22a1dbf..b78ca2cd65 100644 --- a/internal/npm_install/test/golden/@gregmagolan/test-a/bin/BUILD.bazel.golden +++ b/internal/npm_install/test/golden/@gregmagolan/test-a/bin/BUILD.bazel.golden @@ -5,5 +5,4 @@ nodejs_binary( name = "test", entry_point = "//:node_modules/@gregmagolan/test-a/@bin/test.js", data = ["//@gregmagolan/test-a:test-a"], - templated_args = ["--nobazel_patch_module_resolver"], ) diff --git a/internal/npm_install/test/golden/@gregmagolan/test-a/index.bzl.golden b/internal/npm_install/test/golden/@gregmagolan/test-a/index.bzl.golden index bd6420ee64..a386d4ac6b 100644 --- a/internal/npm_install/test/golden/@gregmagolan/test-a/index.bzl.golden +++ b/internal/npm_install/test/golden/@gregmagolan/test-a/index.bzl.golden @@ -7,13 +7,13 @@ def test(**kwargs): nodejs_binary( entry_point = "@fine_grained_goldens//:node_modules/@gregmagolan/test-a/@bin/test.js", data = ["@fine_grained_goldens//@gregmagolan/test-a:test-a"] + kwargs.pop("data", []), - templated_args = ["--nobazel_patch_module_resolver"] + kwargs.pop("templated_args", []), + templated_args = kwargs.pop("templated_args", []), **kwargs ) def test_test(**kwargs): nodejs_test( entry_point = "@fine_grained_goldens//:node_modules/@gregmagolan/test-a/@bin/test.js", data = ["@fine_grained_goldens//@gregmagolan/test-a:test-a"] + kwargs.pop("data", []), - templated_args = ["--nobazel_patch_module_resolver"] + kwargs.pop("templated_args", []), + templated_args = kwargs.pop("templated_args", []), **kwargs ) diff --git a/internal/npm_install/test/golden/jasmine/bin/BUILD.bazel.golden b/internal/npm_install/test/golden/jasmine/bin/BUILD.bazel.golden index b1b65eb5de..9748049b8a 100644 --- a/internal/npm_install/test/golden/jasmine/bin/BUILD.bazel.golden +++ b/internal/npm_install/test/golden/jasmine/bin/BUILD.bazel.golden @@ -5,5 +5,4 @@ nodejs_binary( name = "jasmine", entry_point = "//:node_modules/jasmine/bin/jasmine.js", data = ["//jasmine:jasmine"], - templated_args = ["--nobazel_patch_module_resolver"], ) diff --git a/internal/npm_install/test/golden/jasmine/index.bzl.golden b/internal/npm_install/test/golden/jasmine/index.bzl.golden index 95c02cce05..ec701d22ec 100644 --- a/internal/npm_install/test/golden/jasmine/index.bzl.golden +++ b/internal/npm_install/test/golden/jasmine/index.bzl.golden @@ -7,13 +7,13 @@ def jasmine(**kwargs): nodejs_binary( entry_point = "@fine_grained_goldens//:node_modules/jasmine/bin/jasmine.js", data = ["@fine_grained_goldens//jasmine:jasmine"] + kwargs.pop("data", []), - templated_args = ["--nobazel_patch_module_resolver"] + kwargs.pop("templated_args", []), + templated_args = kwargs.pop("templated_args", []), **kwargs ) def jasmine_test(**kwargs): nodejs_test( entry_point = "@fine_grained_goldens//:node_modules/jasmine/bin/jasmine.js", data = ["@fine_grained_goldens//jasmine:jasmine"] + kwargs.pop("data", []), - templated_args = ["--nobazel_patch_module_resolver"] + kwargs.pop("templated_args", []), + templated_args = kwargs.pop("templated_args", []), **kwargs ) diff --git a/internal/pkg_npm/BUILD.bazel b/internal/pkg_npm/BUILD.bazel index ea0addbeb3..6b63c3478d 100644 --- a/internal/pkg_npm/BUILD.bazel +++ b/internal/pkg_npm/BUILD.bazel @@ -16,6 +16,7 @@ nodejs_binary( name = "packager", data = ["//third_party/github.com/gjtorikian/isBinaryFile"], entry_point = ":packager.js", + templated_args = ["--bazel_patch_module_resolver"], ) nodejs_binary( diff --git a/internal/pkg_npm/test/directory/BUILD.bazel b/internal/pkg_npm/test/directory/BUILD.bazel index 25501a5e65..7e3daf4d29 100644 --- a/internal/pkg_npm/test/directory/BUILD.bazel +++ b/internal/pkg_npm/test/directory/BUILD.bazel @@ -22,5 +22,4 @@ nodejs_test( ":folder_pkg", ], entry_point = "main.js", - templated_args = ["--nobazel_patch_module_resolver"], ) diff --git a/internal/pkg_npm/test/linking/BUILD.bazel b/internal/pkg_npm/test/linking/BUILD.bazel index f4a5673248..858ae60920 100644 --- a/internal/pkg_npm/test/linking/BUILD.bazel +++ b/internal/pkg_npm/test/linking/BUILD.bazel @@ -86,5 +86,4 @@ nodejs_test( "//internal/pkg_npm/test/linking/fuz:scoped_fuz", ], entry_point = ":main.js", - templated_args = ["--nobazel_patch_module_resolver"], ) diff --git a/internal/pkg_web/BUILD.bazel b/internal/pkg_web/BUILD.bazel index b0cfabca5e..72c0aad9d1 100644 --- a/internal/pkg_web/BUILD.bazel +++ b/internal/pkg_web/BUILD.bazel @@ -27,6 +27,7 @@ nodejs_binary( ], entry_point = ":assembler.js", node_modules = ":node_modules_none", + templated_args = ["--bazel_patch_module_resolver"], ) # BEGIN-INTERNAL diff --git a/internal/pkg_web/test2/BUILD.bazel b/internal/pkg_web/test2/BUILD.bazel index 8a7a75e0f2..47bfdc76e6 100644 --- a/internal/pkg_web/test2/BUILD.bazel +++ b/internal/pkg_web/test2/BUILD.bazel @@ -98,4 +98,5 @@ jasmine_node_test( tags = [ "fix-windows", ], + templated_args = ["--bazel_patch_module_resolver"], ) diff --git a/internal/providers/node_runtime_deps_info.bzl b/internal/providers/node_runtime_deps_info.bzl index e08fef2bb8..bf22fe7a08 100644 --- a/internal/providers/node_runtime_deps_info.bzl +++ b/internal/providers/node_runtime_deps_info.bzl @@ -112,11 +112,6 @@ def run_node(ctx, inputs, arguments, executable, **kwargs): add_arg(arguments, "--bazel_capture_exit_code=%s" % exit_code_file.path) outputs = outputs + [exit_code_file] - # By using the run_node helper, you suggest that your program - # doesn't implicitly use runfiles to require() things - # To access runfiles, you must use a runfiles helper in the program instead - add_arg(arguments, "--nobazel_patch_module_resolver") - env = kwargs.pop("env", {}) # Always forward the COMPILATION_MODE to node process as an environment variable diff --git a/packages/concatjs/web_test/test/karma_typescript/BUILD.bazel b/packages/concatjs/web_test/test/karma_typescript/BUILD.bazel index 60fbe139be..36afcf7599 100644 --- a/packages/concatjs/web_test/test/karma_typescript/BUILD.bazel +++ b/packages/concatjs/web_test/test/karma_typescript/BUILD.bazel @@ -86,4 +86,5 @@ jasmine_node_test( data = [ ":testing_chromium-local", ], + templated_args = ["--bazel_patch_module_resolver"], ) diff --git a/packages/cypress/internal/template.cypress_web_test.bzl b/packages/cypress/internal/template.cypress_web_test.bzl index 77a371ab92..6a895493ec 100644 --- a/packages/cypress/internal/template.cypress_web_test.bzl +++ b/packages/cypress/internal/template.cypress_web_test.bzl @@ -112,7 +112,6 @@ def cypress_web_test( ] + srcs, entry_point = "@build_bazel_rules_nodejs//packages/cypress:internal/run-cypress.js", templated_args = [ - "--nobazel_patch_module_resolver", "$(rootpath {config_file})".format(config_file = config_file), "$(rootpath {cypress_plugin})".format(cypress_plugin = cypress_plugin), "$(rootpath {cypress_archive})".format(cypress_archive = cypress_archive), @@ -154,7 +153,6 @@ def cypress_web_test_global_cache( ] + srcs, entry_point = "@build_bazel_rules_nodejs//packages/cypress:internal/run-cypress.js", templated_args = [ - "--nobazel_patch_module_resolver", "$(rootpath {config_file})".format(config_file = config_file), "$(rootpath {cypress_plugin})".format(cypress_plugin = cypress_plugin), ] + templated_args, diff --git a/packages/labs/grpc_web/BUILD.bazel b/packages/labs/grpc_web/BUILD.bazel index a182bd1407..852864fc3e 100644 --- a/packages/labs/grpc_web/BUILD.bazel +++ b/packages/labs/grpc_web/BUILD.bazel @@ -15,6 +15,7 @@ nodejs_binary( name = "change_import_style", entry_point = ":change_import_style.js", node_modules = "@build_bazel_rules_typescript_grpc_web_compiletime_deps//:node_modules", + templated_args = ["--bazel_patch_module_resolver"], visibility = ["//visibility:public"], ) diff --git a/packages/labs/test/grpc_web/BUILD.bazel b/packages/labs/test/grpc_web/BUILD.bazel index d69bde0f8d..9629d75a24 100644 --- a/packages/labs/test/grpc_web/BUILD.bazel +++ b/packages/labs/test/grpc_web/BUILD.bazel @@ -10,6 +10,7 @@ jasmine_node_test( "@npm//google-protobuf", "@npm//grpc-web", ], + templated_args = ["--bazel_patch_module_resolver"], deps = [ ":commonjs_test_lib", ], diff --git a/packages/labs/test/protobufjs/BUILD.bazel b/packages/labs/test/protobufjs/BUILD.bazel index 28b9802a17..ddcf2d6397 100644 --- a/packages/labs/test/protobufjs/BUILD.bazel +++ b/packages/labs/test/protobufjs/BUILD.bazel @@ -25,6 +25,7 @@ protobufjs_ts_library( jasmine_node_test( name = "protobuf_test", srcs = [":test"], + templated_args = ["--bazel_patch_module_resolver"], deps = [ "@npm//protobufjs", ], diff --git a/packages/node-patches/BUILD.bazel b/packages/node-patches/BUILD.bazel index cb392adbdf..013397d51f 100644 --- a/packages/node-patches/BUILD.bazel +++ b/packages/node-patches/BUILD.bazel @@ -60,7 +60,13 @@ nodejs_test( ], entry_point = "@npm_node_patches//:node_modules/mocha/bin/mocha", tags = ["fix-windows"], - templated_args = ["$$(rlocation $(rootpath %s))" % s for s in test_js] + ["--nobazel_node_patches"], + templated_args = [ + "$$(rlocation $(rootpath %s))" % s + for s in test_js + ] + [ + "--nobazel_node_patches", + "--bazel_patch_module_resolver", + ], ) rollup_bundle( diff --git a/packages/protractor/protractor_web_test.bzl b/packages/protractor/protractor_web_test.bzl index 7639822a1f..12fdd5bab5 100644 --- a/packages/protractor/protractor_web_test.bzl +++ b/packages/protractor/protractor_web_test.bzl @@ -261,6 +261,7 @@ def protractor_web_test( entry_point = Label(protractor_entry_point), data = srcs + deps + data + [Label(d) for d in peer_deps], testonly = 1, + templated_args = ["--bazel_patch_module_resolver"], visibility = ["//visibility:private"], ) diff --git a/packages/protractor/test/protractor-utils/BUILD.bazel b/packages/protractor/test/protractor-utils/BUILD.bazel index 0677e3e08a..0b3ae26eb2 100644 --- a/packages/protractor/test/protractor-utils/BUILD.bazel +++ b/packages/protractor/test/protractor-utils/BUILD.bazel @@ -29,4 +29,5 @@ jasmine_node_test( data = [ ":fake-devserver", ], + templated_args = ["--bazel_patch_module_resolver"], ) diff --git a/packages/rollup/install.md b/packages/rollup/install.md index 0278e6a556..8fa7b404c1 100644 --- a/packages/rollup/install.md +++ b/packages/rollup/install.md @@ -144,7 +144,6 @@ nodejs_binary( data = ["@npm//rollup:rollup"], entry_point = "@npm//:node_modules/rollup/dist/bin/rollup", templated_args = [ - "--nobazel_patch_module_resolver", "--node_options=--max-old-space-size=", ], ) diff --git a/packages/rollup/test/integration/golden.amd.js.map.sha256_ b/packages/rollup/test/integration/golden.amd.js.map.sha256_ index 171382c002..53ba7577fc 100644 --- a/packages/rollup/test/integration/golden.amd.js.map.sha256_ +++ b/packages/rollup/test/integration/golden.amd.js.map.sha256_ @@ -1 +1 @@ -c924104f49b195bc75b35b75e0b2ef151c06d920a7fbef8788dff3af1ee673df \ No newline at end of file +a3f8b014324476ec5fa98c03bce988bfecac12f63fbc7d985b9a4b15d9da9fbd \ No newline at end of file diff --git a/packages/rollup/test/integration/golden.cjs.js.map.sha256_ b/packages/rollup/test/integration/golden.cjs.js.map.sha256_ index 13fb35c366..a5c029e973 100644 --- a/packages/rollup/test/integration/golden.cjs.js.map.sha256_ +++ b/packages/rollup/test/integration/golden.cjs.js.map.sha256_ @@ -1 +1 @@ -86daf398a91b909de1ba663bad9aeff0373fa7e859c304308d6e98d341c7bbc1 \ No newline at end of file +4b2ff88ab16971f40b088e95aaa39e94d2e2b81daca6ec6f1bf3012143ba56b6 \ No newline at end of file diff --git a/packages/rollup/test/integration/golden.esm.js.map.sha256_ b/packages/rollup/test/integration/golden.esm.js.map.sha256_ index 317b7a9970..b1b00a7608 100644 --- a/packages/rollup/test/integration/golden.esm.js.map.sha256_ +++ b/packages/rollup/test/integration/golden.esm.js.map.sha256_ @@ -1 +1 @@ -9fe0f43821c5735b20edad3f95d2e2c26d9d495ad94831cbb1cf7a73642cde8c \ No newline at end of file +91ac056e05a90641cfa1c98150da7a14b4808054bec52b07eedc4446a29ba405 \ No newline at end of file diff --git a/packages/rollup/test/integration/golden.iife.js.map.sha256_ b/packages/rollup/test/integration/golden.iife.js.map.sha256_ index 32365ad2d8..bd47c5b685 100644 --- a/packages/rollup/test/integration/golden.iife.js.map.sha256_ +++ b/packages/rollup/test/integration/golden.iife.js.map.sha256_ @@ -1 +1 @@ -85c4599e6a6f490460e8fad9232da3ec58601e18e47e893c25515bb94b3f78c8 \ No newline at end of file +fff049369f53744768edf11e8f5e7dafe23d2ba371eabbdf7cc93476b63ce4f7 \ No newline at end of file diff --git a/packages/rollup/test/integration/golden.system.js.map.sha256_ b/packages/rollup/test/integration/golden.system.js.map.sha256_ index b5ea792fb3..e8611e9b8d 100644 --- a/packages/rollup/test/integration/golden.system.js.map.sha256_ +++ b/packages/rollup/test/integration/golden.system.js.map.sha256_ @@ -1 +1 @@ -b92a8678d60a94ecf3b0d87252547db66b6256db6c6437eb433530c3fdba019c \ No newline at end of file +c12b5ed8272cf67e1545e66d776c86a1753a3632f416d95f5021e36affbd41d0 \ No newline at end of file diff --git a/packages/rollup/test/integration/golden.umd.js.map.sha256_ b/packages/rollup/test/integration/golden.umd.js.map.sha256_ index bfb3f70a96..ef96c5bec6 100644 --- a/packages/rollup/test/integration/golden.umd.js.map.sha256_ +++ b/packages/rollup/test/integration/golden.umd.js.map.sha256_ @@ -1 +1 @@ -735d657abe96a1ea940285eda0bef75fe15d0a86db9bd11bef0301d14c9ebaff \ No newline at end of file +dc75f9638fa21e6126de2de2d75e1ec865b5481a4fa69c0cc464e2398fa752c2 \ No newline at end of file diff --git a/packages/terser/test/BUILD.bazel b/packages/terser/test/BUILD.bazel index e2ef4a9d0f..edc35bad85 100644 --- a/packages/terser/test/BUILD.bazel +++ b/packages/terser/test/BUILD.bazel @@ -3,6 +3,7 @@ load("//packages/jasmine:index.bzl", "jasmine_node_test") jasmine_node_test( name = "test", srcs = ["directory-args.spec.js"], + templated_args = ["--bazel_patch_module_resolver"], deps = [ "//packages/terser:index.js", "@npm//tmp", diff --git a/packages/terser/test/exec/BUILD.bazel b/packages/terser/test/exec/BUILD.bazel index cc4ec2145f..f5427b5be0 100644 --- a/packages/terser/test/exec/BUILD.bazel +++ b/packages/terser/test/exec/BUILD.bazel @@ -7,4 +7,5 @@ jasmine_node_test( "//packages/terser:index.js", ], tags = ["exclusive"], + templated_args = ["--bazel_patch_module_resolver"], ) diff --git a/packages/terser/test/sourcemap/BUILD.bazel b/packages/terser/test/sourcemap/BUILD.bazel index d09fba1819..4e5e4be5fd 100644 --- a/packages/terser/test/sourcemap/BUILD.bazel +++ b/packages/terser/test/sourcemap/BUILD.bazel @@ -21,6 +21,7 @@ jasmine_node_test( "terser_spec.js", ], data = ["@npm//source-map"], + templated_args = ["--bazel_patch_module_resolver"], deps = [ ":src1.min", ], diff --git a/packages/typescript/internal/ts_project.bzl b/packages/typescript/internal/ts_project.bzl index 7a094a5f66..9a61d1a77e 100644 --- a/packages/typescript/internal/ts_project.bzl +++ b/packages/typescript/internal/ts_project.bzl @@ -644,7 +644,6 @@ def ts_project_macro( ], entry_point = Label("//packages/typescript/internal/worker:worker_adapter"), templated_args = [ - "--nobazel_patch_module_resolver", "$(execpath {})".format(Label(worker_tsc_bin)), "--project", "$(execpath {})".format(tsconfig), diff --git a/packages/typescript/test/some_module/BUILD.bazel b/packages/typescript/test/some_module/BUILD.bazel index a474e43bcf..3cb7b28c2d 100644 --- a/packages/typescript/test/some_module/BUILD.bazel +++ b/packages/typescript/test/some_module/BUILD.bazel @@ -54,8 +54,7 @@ nodejs_binary( # custom rule using the executable above via run_node # invoked via bazel build //packages/typescript/test/some_module:test -# as --nobazel_patch_module_resolver is added by default by run_node, the entry_point on the executable is resolved -# to the ts file - writer.ts +# the entry_point on the executable is resolved to the ts file - writer.ts # this works for bazel run //packages/typescript/test/some_module:writer_bin as this will patch require and resolve the # ts to js ts_write_file( diff --git a/packages/typescript/test/ts_project/a/tsconfig.json b/packages/typescript/test/ts_project/a/tsconfig.json index 3e6e16dcfc..2feec65a00 100644 --- a/packages/typescript/test/ts_project/a/tsconfig.json +++ b/packages/typescript/test/ts_project/a/tsconfig.json @@ -12,9 +12,9 @@ // (05:54:49) ERROR: C:/b/bk-windows-b4qr/bazel/rules-nodejs-nodejs/packages/typescript/test/ts_project/b/BUILD.bazel:6:1: Compiling TypeScript project packages/typescript/test/ts_project/b/tsconfig.json failed (Exit 2): tsc.bat failed: error executing command // cd C:/b/uuxnwop3/execroot/build_bazel_rules_nodejs // SET COMPILATION_MODE=fastbuild - // bazel-out/host/bin/external/npm/typescript/bin/tsc.bat -p packages/typescript/test/ts_project/b/tsconfig.json --outDir bazel-out/x64_windows-fastbuild/bin/packages/typescript/test/ts_project/b --declarationDir bazel-out/x64_windows-fastbuild/bin/packages/typescript/test/ts_project/b --bazel_node_modules_manifest=bazel-out/x64_windows-fastbuild/bin/packages/typescript/test/ts_project/b/_tsconfig.module_mappings.json --nobazel_patch_module_resolver + // bazel-out/host/bin/external/npm/typescript/bin/tsc.bat -p packages/typescript/test/ts_project/b/tsconfig.json --outDir bazel-out/x64_windows-fastbuild/bin/packages/typescript/test/ts_project/b --declarationDir bazel-out/x64_windows-fastbuild/bin/packages/typescript/test/ts_project/b --bazel_node_modules_manifest=bazel-out/x64_windows-fastbuild/bin/packages/typescript/test/ts_project/b/_tsconfig.module_mappings.json // Execution platform: @local_config_platform//:host // packages/typescript/test/ts_project/b/b.ts(1,17): error TS6305: Output file 'C:/b/uuxnwop3/execroot/build_bazel_rules_nodejs/packages/typescript/test/ts_project/a/a.d.ts' has not been built from source file 'C:/b/uuxnwop3/execroot/build_bazel_rules_nodejs/packages/typescript/test/ts_project/a/a.ts'. "outDir": "../../../../../bazel-out/x64_windows-fastbuild/bin/packages/typescript/test/ts_project/a", } -} \ No newline at end of file +}