Skip to content

Instantly share code, notes, and snippets.

@busti
Created May 18, 2019 15:24
Show Gist options
  • Save busti/51926dc1ca265ebf6209ec1f8f063d7e to your computer and use it in GitHub Desktop.
Save busti/51926dc1ca265ebf6209ec1f8f063d7e to your computer and use it in GitHub Desktop.
Build sbt example for sbt-revolver and sbt-web
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