Can't set scalaJSStage for configurations other than Global
My project structure is mostly based on https://github.com/vmunier/play-scalajs.g8
The current suggestion there is to run packaging with sbt 'set Global / scalaJSStage := FullOptStage' Universal/packageBin this is ok as a workaround but obviously not ideal compared to being able to set Universal / scalaJSStage := FullOptStage in build.sbt so that fast opt is the default behaviour and only native packaging configs and tasks use full opt. I'm a little unsure if this setting would go in server or client, i'm guessing client would be preferable in case someone really wants multiple client projects with different opt settings.
I tried looking over the plugin but submitting a PR for it is a little beyond my current knowledge, please consider this enhancement request.
changing ScalaJSStageTasks.scala line 11 from scalaJSStage.value match { to configuration.value / scalaJSStage.value match { might be all it needs?
I tried to make it... but sbt has to much magic. :(.
def onScalaJSStage[A](onFastOpt: => Initialize[A], onFullOpt: => Initialize[A]): Initialize[A] =
Def.settingDyn {
val cog = configuration.value
Def.settingDyn {
(ThisBuild / cog / scalaJSStage).value match {
case Stage.FastOpt => onFastOpt
case Stage.FullOpt => onFullOpt
}
}
}
It could be made, but still Universal:packageBin will compile js-project with Compile configuration.