From 4f503eeb91b6523b72c28b07805c076ca42d6764 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 2 Dec 2020 10:44:37 -0800 Subject: [PATCH] prepare for breaking change in rules_nodejs https://github.com/bazelbuild/rules_nodejs/issues/2125 is going to turn off the patching of the require() function by default. The reason is that it breaks compatibility with many node programs. However rules_sass depends on this, and also has at least conceptual sharing with google3 which uses the patched require() as well. This change is a no-op for rules_nodejs 2.x where the default is true, but is required with rules_nodejs 3.0 where it will be false. --- sass/BUILD | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sass/BUILD b/sass/BUILD index 5ebb982..332ac22 100644 --- a/sass/BUILD +++ b/sass/BUILD @@ -16,4 +16,7 @@ nodejs_binary( "@build_bazel_rules_sass_deps//sass", "@build_bazel_rules_sass_deps//@bazel/worker", ], + # Opt-in to the patched require() function like google3 has + # rules_nodejs 3.0 will flip the default for this flag which breaks rules_sass users + templated_args = ["--bazel_patch_module_resolver"], )