Open ptrdom opened 2 years ago
This is something that can be done with a custom NodeJSEnv.Config
:
import org.scalajs.jsenv.nodejs.NodeJSEnv
jsEnv := {
new NodeJSEnv(NodeJSEnv.Config()
.withExecutable("nvs")
.withArgs(List("exec", ver)))
}
When suggesting this I mainly had interactions with Webpack in mind:
Wouldn't that be possible to do in user space using #420, then?
No, because that PR does not expose these bundler related node
invocations that I have linked above. New setting is the only way. Do not see a problem here - it is a beneficial change that is easily backwards compatible.
This is somewhat related to https://github.com/scalacenter/scalajs-bundler/issues/418 - instead of directly supporting some node version manager, we could expose a setting that would allow users to set a
node
executable, similar to howsbt-native-packager
does it with dockerExecCommand. Then users ofscalajs-bundler
could wire in for example https://github.com/jasongin/nvs by settingnodeExecCommand
tonvs exec <ver>
.How does this sound @sjrd?