outwatch-test/build.sbt
2020-12-27 20:28:19 +05:30

126 lines
4.5 KiB
Scala

//organization := "wow.doge"
//name := "Outwatchtest"
//version := "0.1.0"
name := "OutwatchApp"
scalaVersion := "2.13.4"
resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies ++= Seq(
"com.github.outwatch.outwatch" %%% "outwatch" % "61deece8",
"com.github.outwatch.outwatch" %%% "outwatch-util" % "master-SNAPSHOT",
"com.github.cornerman.colibri" %%% "colibri-monix" % "master-SNAPSHOT",
"com.github.outwatch.outwatch" %%% "outwatch-monix" % "master-SNAPSHOT",
"org.scalatest" %%% "scalatest" % "3.2.0" % Test,
"org.typelevel" %%% "cats-core" % "2.1.1",
"org.typelevel" %%% "cats-effect" % "2.1.4",
"io.monix" %%% "monix" % "3.2.2",
"io.monix" %%% "monix-bio" % "1.1.0",
"io.circe" %%% "circe-core" % "0.13.0",
"io.circe" %%% "circe-generic" % "0.13.0",
"com.softwaremill.sttp.client" %%% "core" % "2.2.5",
"com.softwaremill.sttp.client" %%% "monix" % "2.2.5",
"com.softwaremill.sttp.client" %%% "circe" % "2.2.5",
// "com.softwaremill.sttp.client" %%% "async-http-client-backend-monix" % "2.2.5",
// "com.softwaremill.sttp.client3" %%% "httpclient-backend-monix" % "2.2.5",
// "com.softwaremill.macwire" %%% "util" % "2.3.7",
"com.softwaremill.macwire" %% "macros" % "2.3.7" % "provided",
// "com.softwaremill.macwire" %%% "macrosakka" % "2.3.6" % "provided",
"com.softwaremill.quicklens" %%% "quicklens" % "1.6.1",
// "com.typesafe.scala-logging" %%% "scala-logging" % "3.9.2",
// "io.circe" %%% "circe-config" % "0.8.0",
"org.akka-js" %%% "shocon" % "1.0.0",
"com.beachape" %%% "enumeratum-circe" % "1.6.1"
// "com.clovellytech" %%% "outwatch-router" % "0.0.9+7-5be0b1a2+20201227-2019-SNAPSHOT"
)
Compile / npmDependencies ++= Seq(
// "jquery" -> "1.9.1",
// "popper.js" -> "1.16.1",
// // "@popperjs/core" -> "2.6.0",
// "blk-design-system" -> "1.0.2",
// "bootstrap" -> "4.5.3"
"snabbdom" -> "git://github.com/outwatch/snabbdom.git#semver:0.7.5"
)
// Compile / npmDevDependencies ++= Seq(
// "css-loader" -> "5.0.1",
// "style-loader" -> "2.0.0"
// )
// stIgnore ++= List("jquery", "blk-design-system", "bootstrap")
stIgnore ++= List("snabbdom")
enablePlugins(ScalaJSBundlerPlugin)
enablePlugins(ScalablyTypedConverterPlugin)
useYarn := true // makes scalajs-bundler use yarn instead of npm
requireJsDomEnv in Test := true
scalaJSUseMainModuleInitializer := true
// configure Scala.js to emit a JavaScript module instead of a top-level script
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))
scalacOptions ++=
Seq(
"-encoding",
"UTF-8",
"-deprecation",
"-feature",
"-language:existentials",
"-language:experimental.macros",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xlint",
"-Ywarn-numeric-widen",
"-Ymacro-annotations",
//silence warnings for by-name implicits
"-Wconf:cat=lint-byname-implicit:s",
//give errors on non exhaustive matches
"-Wconf:msg=match may not be exhaustive:e",
"-explaintypes" // Explain type errors in more detail.
)
// hot reloading configuration:
// https://github.com/scalacenter/scalajs-bundler/issues/180
addCommandAlias(
"dev",
"; compile; fastOptJS::startWebpackDevServer; devwatch; fastOptJS::stopWebpackDevServer"
)
addCommandAlias("devwatch", "~; fastOptJS; copyFastOptJS")
version in webpack := "4.43.0"
version in startWebpackDevServer := "3.11.0"
webpackDevServerExtraArgs := Seq("--progress", "--color")
webpackDevServerPort := 8080
webpackConfigFile in fastOptJS := Some(
baseDirectory.value / "webpack.config.dev.js"
)
// webpackConfigFile in fullOptJS := Some(
// baseDirectory.value / "webpack.config.js"
// )
// https://scalacenter.github.io/scalajs-bundler/cookbook.html#performance
webpackBundlingMode in fastOptJS := BundlingMode.LibraryOnly()
// when running the "dev" alias, after every fastOptJS compile all artifacts are copied into
// a folder which is served and watched by the webpack devserver.
// this is a workaround for: https://github.com/scalacenter/scalajs-bundler/issues/180
lazy val copyFastOptJS =
TaskKey[Unit]("copyFastOptJS", "Copy javascript files to target directory")
copyFastOptJS := {
val inDir = (crossTarget in (Compile, fastOptJS)).value
val outDir = (crossTarget in (Compile, fastOptJS)).value / "dev"
val files = Seq(
name.value.toLowerCase + "-fastopt-loader.js",
name.value.toLowerCase + "-fastopt.js",
name.value.toLowerCase + "-fastopt.js.map"
) map { p => (inDir / p, outDir / p) }
IO.copy(
files,
overwrite = true,
preserveLastModified = true,
preserveExecutable = true
)
}