Created
May 18, 2019 15:24
-
-
Save busti/51926dc1ca265ebf6209ec1f8f063d7e to your computer and use it in GitHub Desktop.
Build sbt example for sbt-revolver and sbt-web
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy val server = project | |
.settings(commonSettings) | |
.settings( | |
scalacOptions ++= Seq("-Ypartial-unification"), | |
scalaJSProjects := Seq(client), | |
pipelineStages in Assets := Seq(scalaJSPipeline), | |
compile in Compile := ((compile in Compile) dependsOn scalaJSPipeline).value, | |
WebKeys.packagePrefix in Assets := "public/", | |
managedClasspath in Runtime += (packageBin in Assets).value, | |
) | |
.enablePlugins(SbtWeb, WebScalaJSBundlerPlugin) | |
lazy val client = project | |
.settings(commonSettings) | |
.settings( | |
scalaJSUseMainModuleInitializer := true, | |
scalaJSModuleKind := ModuleKind.CommonJSModule, | |
//useYarn := true, | |
webpackBundlingMode in fastOptJS := BundlingMode.Application, | |
emitSourceMaps := true, | |
scalaJSLinkerConfig in (Compile, fastOptJS) ~= { _.withSourceMap(true) }, | |
scalaJSLinkerConfig in (Compile, fullOptJS) ~= { _.withSourceMap(true) }, | |
) | |
.enablePlugins(ScalaJSPlugin, ScalaJSWeb, ScalaJSBundlerPlugin) | |
.dependsOn(outwatch) | |
// loads the server project at sbt startup // | |
onLoad in Global := (onLoad in Global).value andThen { s: State => | |
"project server" :: s | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment