You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. lazy val server = (project in file("server"))
  2. .settings(commonSettings)
  3. .settings(
  4. scalaJSProjects := Seq(client),
  5. pipelineStages in Assets := Seq(scalaJSPipeline),
  6. pipelineStages := Seq(digest, gzip),
  7. // triggers scalaJSPipeline when using compile or continuous compilation
  8. compile in Compile := ((compile in Compile) dependsOn scalaJSPipeline).value,
  9. libraryDependencies ++= Seq(
  10. "com.vmunier" %% "scalajs-scripts" % "1.1.4",
  11. guice,
  12. specs2 % Test,
  13. "com.softwaremill.quicklens" %% "quicklens" % "1.6.0"
  14. ),
  15. // Compile the project before generating Eclipse files, so that generated .scala or .class files for views and routes are present
  16. EclipseKeys.preTasks := Seq(compile in Compile)
  17. )
  18. .enablePlugins(PlayScala)
  19. .enablePlugins(SbtWeb)
  20. .enablePlugins(WebScalaJSBundlerPlugin)
  21. .dependsOn(sharedJvm)
  22. lazy val client = (project in file("client"))
  23. .settings(commonSettings)
  24. .settings(
  25. scalaJSUseMainModuleInitializer := true,
  26. libraryDependencies ++= Seq(
  27. "org.scala-js" %%% "scalajs-dom" % "1.0.0",
  28. "com.github.japgolly.scalajs-react" %%% "core" % "1.7.0",
  29. "com.github.japgolly.scalajs-react" %%% "extra" % "1.7.0",
  30. // "com.github.japgolly.scalajs-react" %%% "ext-monocle" % "1.7.0",
  31. "com.github.japgolly.scalajs-react" %%% "ext-monocle-cats" % "1.7.0",
  32. "com.softwaremill.quicklens" %%% "quicklens" % "1.5.0",
  33. "com.github.julien-truffaut" %%% "monocle-core" % "2.0.4",
  34. "com.github.julien-truffaut" %%% "monocle-macro" % "2.0.4",
  35. "org.typelevel" %%% "cats-core" % "2.1.1"
  36. // "com.github.japgolly.scalajs-react" %%% "test" % "1.7.0",
  37. ),
  38. scalacOptions ++= Seq("-Ymacro-annotations", "-deprecation"),
  39. useYarn := true,
  40. stFlavour := Flavour.Japgolly,
  41. Compile / npmDependencies ++= Seq(
  42. "react" -> "16.13.1",
  43. "react-dom" -> "16.13.1",
  44. "@types/react" -> "16.9.34",
  45. "@types/react-dom" -> "16.9.6"
  46. )
  47. )
  48. .enablePlugins(ScalaJSPlugin)
  49. .enablePlugins(ScalaJSBundlerPlugin)
  50. .enablePlugins(ScalablyTypedConverterPlugin)
  51. .dependsOn(sharedJs)
  52. lazy val shared = crossProject(JSPlatform, JVMPlatform)
  53. .crossType(CrossType.Pure)
  54. .in(file("shared"))
  55. .settings(commonSettings)
  56. // .jsConfigure(_.enablePlugins(ScalaJSWeb))
  57. .jsConfigure(
  58. _.enablePlugins(ScalaJSBundlerPlugin)
  59. // .enablePlugins(ScalablyTypedConverterPlugin)
  60. )
  61. lazy val sharedJvm = shared.jvm
  62. lazy val sharedJs = shared.js
  63. lazy val commonSettings = Seq(
  64. scalaVersion := "2.13.2",
  65. organization := "com.example"
  66. )