[FR]: Transitions on compilation modes for npm packages
What is the current behavior?
When building with different compilation modes users will download/extract npm packages for each one. When they use different compilation modes, there's no transition in place for external packages so users actually get at least 3 layouts of third party packages.
Describe the feature
We have a set up where cpp developers would use -c dbg and other teams might do -c opt for various reasons, but mostly they would always default on fastbuild.
As with pnpm workspaces we might want custom control over js_library(pkg) for external packages it would be great to always transition to one particular compilation mode (maybe opt as the default?)
Pending issues:
Agreed - it's interesting how bazel_env.bzl always transitions to a stable config for downloaded tools. We could have a custom bazel-out/npm/bin for example