Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set scalaJSStage for configurations other than Global #130

Open
ianknowles opened this issue Aug 7, 2021 · 2 comments
Open

Can't set scalaJSStage for configurations other than Global #130

ianknowles opened this issue Aug 7, 2021 · 2 comments

Comments

@ianknowles
Copy link

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.

@ianknowles
Copy link
Author

changing ScalaJSStageTasks.scala line 11 from scalaJSStage.value match { to configuration.value / scalaJSStage.value match { might be all it needs?

@scalway
Copy link

scalway commented Dec 10, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants