start factoring out common components
This commit is contained in:
parent
7ae0c3f263
commit
6d029efeaf
2 changed files with 75 additions and 9 deletions
84
build.sbt
84
build.sbt
|
|
@ -1,16 +1,85 @@
|
|||
import org.scalajs.linker.interface.ModuleSplitStyle
|
||||
|
||||
lazy val fahrtenbuch = project
|
||||
.in(file("."))
|
||||
ThisBuild / version := "0.1.0-SNAPSHOT"
|
||||
ThisBuild / scalaVersion := "3.7.1"
|
||||
ThisBuild / scalacOptions ++= Seq("-Xfatal-warnings", "-Wunused:imports")
|
||||
|
||||
lazy val commonDependencies = Seq(
|
||||
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.8.0",
|
||||
libraryDependencies += "com.raquo" %%% "laminar" % "17.2.1",
|
||||
libraryDependencies += "de.tu-darmstadt.stg" %%% "rdts" % "0.37.0",
|
||||
libraryDependencies += "org.getshaka" %%% "native-converter" % "0.9.0"
|
||||
)
|
||||
|
||||
lazy val core = project
|
||||
.in(file("core"))
|
||||
.enablePlugins(
|
||||
ScalaJSPlugin,
|
||||
ScalablyTypedConverterExternalNpmPlugin
|
||||
)
|
||||
.settings(
|
||||
scalaVersion := "3.7.1",
|
||||
scalacOptions += "-Xfatal-warnings",
|
||||
scalacOptions += "-Wunused:imports",
|
||||
// Tell Scala.js that this is an application with a main method
|
||||
scalaJSUseMainModuleInitializer := true,
|
||||
scalaJSLinkerConfig ~= {
|
||||
_.withModuleKind(ModuleKind.ESModule)
|
||||
.withModuleSplitStyle(
|
||||
ModuleSplitStyle.SmallModulesFor(List("fahrtenbuch"))
|
||||
)
|
||||
},
|
||||
|
||||
// scalably typed config
|
||||
// Ignore several Trystero dependencies in ScalablyTyped to avoid `stImport` errors
|
||||
stIgnore := List(
|
||||
"libp2p",
|
||||
"firebase",
|
||||
"@supabase/supabase-js",
|
||||
"@mdi/font",
|
||||
"bulma",
|
||||
"@types/node"
|
||||
),
|
||||
externalNpm := baseDirectory.value,
|
||||
commonDependencies
|
||||
)
|
||||
|
||||
lazy val node = project
|
||||
.in(file("node"))
|
||||
.dependsOn(core)
|
||||
.enablePlugins(
|
||||
ScalaJSPlugin,
|
||||
ScalablyTypedConverterExternalNpmPlugin
|
||||
)
|
||||
.settings(
|
||||
// Tell Scala.js that this is an application with a main method
|
||||
scalaJSUseMainModuleInitializer := true,
|
||||
scalaJSLinkerConfig ~= {
|
||||
_.withModuleKind(ModuleKind.ESModule)
|
||||
.withModuleSplitStyle(
|
||||
ModuleSplitStyle.SmallModulesFor(List("fahrtenbuch"))
|
||||
)
|
||||
},
|
||||
|
||||
// scalably typed config
|
||||
// Ignore several Trystero dependencies in ScalablyTyped to avoid `stImport` errors
|
||||
stIgnore := List(
|
||||
"libp2p",
|
||||
"firebase",
|
||||
"@supabase/supabase-js",
|
||||
"@mdi/font",
|
||||
"bulma",
|
||||
"@types/node"
|
||||
),
|
||||
externalNpm := baseDirectory.value,
|
||||
commonDependencies
|
||||
)
|
||||
|
||||
lazy val fahrtenbuch = project
|
||||
.in(file("."))
|
||||
.dependsOn(core)
|
||||
.enablePlugins(
|
||||
ScalaJSPlugin,
|
||||
ScalablyTypedConverterExternalNpmPlugin
|
||||
)
|
||||
.settings(
|
||||
// Tell Scala.js that this is an application with a main method
|
||||
scalaJSUseMainModuleInitializer := true,
|
||||
|
||||
|
|
@ -42,8 +111,5 @@ lazy val fahrtenbuch = project
|
|||
/* Depend on the scalajs-dom library.
|
||||
* It provides static types for the browser DOM APIs.
|
||||
*/
|
||||
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.8.0",
|
||||
libraryDependencies += "com.raquo" %%% "laminar" % "17.2.1",
|
||||
libraryDependencies += "de.tu-darmstadt.stg" %%% "rdts" % "0.37.0",
|
||||
libraryDependencies += "org.getshaka" %%% "native-converter" % "0.9.0"
|
||||
commonDependencies
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue