Skip to content

Instantly share code, notes, and snippets.

@busti
Created December 3, 2018 23:10
Show Gist options
  • Save busti/4faf32153ae9c8317f43704b1860a1ed to your computer and use it in GitHub Desktop.
Save busti/4faf32153ae9c8317f43704b1860a1ed to your computer and use it in GitHub Desktop.
Buildfile for an outwatch project, outdated
name := "foobar"
val commonSettings = Seq(
scalaVersion := "2.12.6",
version := "1.0",
resolvers += "jitpack" at "https://jitpack.io",
)
// Projects //
lazy val server = project
.settings(commonSettings)
.settings(
scalacOptions ++= Seq("-Ypartial-unification"),
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-http" % "10.0.10",
),
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,
npmAssets ++= NpmAssets.ofProject(client) { nodeModules =>
(nodeModules / "@mdi/font") ** "*"
}.value
).enablePlugins(SbtWeb, WebScalaJSBundlerPlugin)
lazy val client = project
.settings(commonSettings)
.settings(
scalaJSUseMainModuleInitializer := true,
scalaJSModuleKind := ModuleKind.CommonJSModule,
//useYarn := true,
webpackBundlingMode in fastOptJS := BundlingMode.Application,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.2",
"com.github.outwatch" % "outwatch" % "master-SNAPSHOT",
"org.typelevel" %%% "mouse" % "0.18",
),
npmDependencies in Compile += "@mdi/font" -> "2.7.94"
).enablePlugins(ScalaJSPlugin, ScalaJSWeb, ScalaJSBundlerPlugin)
// 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