mirror of
https://github.com/phfroidmont/scalive.git
synced 2025-12-25 05:26:59 +01:00
Setup example module with JS bundle configured
This commit is contained in:
parent
486e89c1f1
commit
aae3db841b
7 changed files with 39 additions and 7 deletions
29
build.mill
29
build.mill
|
|
@ -4,6 +4,10 @@ package build
|
|||
|
||||
import mill.*, scalalib.*, javascriptlib.*
|
||||
import mill.api.Task.Simple
|
||||
import java.net.URI
|
||||
import java.nio.file.*
|
||||
import java.nio.file.attribute.BasicFileAttributes
|
||||
import java.util
|
||||
|
||||
trait ScalaCommon extends ScalaModule:
|
||||
def scalaVersion = "3.7.2"
|
||||
|
|
@ -15,10 +19,6 @@ trait ScalaCommon extends ScalaModule:
|
|||
"-Wvalue-discard"
|
||||
)
|
||||
|
||||
object js extends TypeScriptModule:
|
||||
def npmDeps = Seq("morphdom@2.7.7")
|
||||
def mainFileName = "index.ts"
|
||||
|
||||
object core extends ScalaCommon:
|
||||
// Replace with ujson, core shouldn't depend on ZIO
|
||||
def mvnDeps = Seq(mvn"dev.zio::zio-json:0.7.44")
|
||||
|
|
@ -44,9 +44,30 @@ object core extends ScalaCommon:
|
|||
object test extends ScalaTests with scalalib.TestModule.Utest:
|
||||
def utestVersion = "0.9.0"
|
||||
|
||||
object js extends TypeScriptModule:
|
||||
def npmDeps = Seq("morphdom@2.7.7")
|
||||
def mainFileName = "index.ts"
|
||||
|
||||
object zio extends ScalaCommon:
|
||||
def mvnDeps = Seq(mvn"dev.zio::zio-http:3.4.0")
|
||||
def moduleDeps = Seq(core)
|
||||
|
||||
object example extends ScalaCommon:
|
||||
def moduleDeps = Seq(zio)
|
||||
|
||||
def scaliveBundle = Task {
|
||||
os.copy(
|
||||
from = example.js.bundle().path,
|
||||
to = Task.dest / "public" / "app.js",
|
||||
createFolders = true
|
||||
)
|
||||
PathRef(Task.dest)
|
||||
}
|
||||
|
||||
def resources = Task {
|
||||
super.resources() ++ Seq(scaliveBundle())
|
||||
}
|
||||
|
||||
object js extends TypeScriptModule:
|
||||
def mainFileName = "app.ts"
|
||||
def moduleDeps = Seq(core.js)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue