mirror of
https://github.com/phfroidmont/scalive.git
synced 2025-12-25 05:26:59 +01:00
Style example with tailwind
This commit is contained in:
parent
5dbf3d3ab6
commit
44ffa55cc6
5 changed files with 85 additions and 27 deletions
24
build.mill
24
build.mill
|
|
@ -49,10 +49,32 @@ object example extends ScalaCommon:
|
|||
PathRef(Task.dest)
|
||||
}
|
||||
|
||||
def tailwindConfig = Task.Source(moduleDir / "tailwind.css")
|
||||
|
||||
def generateCss = Task {
|
||||
sources()
|
||||
os.proc(
|
||||
"tailwindcss",
|
||||
"--minify",
|
||||
"--input",
|
||||
tailwindConfig().path
|
||||
).call().out.text()
|
||||
}
|
||||
|
||||
def cssResources = Task {
|
||||
os.write(
|
||||
target = Task.dest / "public" / "app.css",
|
||||
data = generateCss(),
|
||||
createFolders = true
|
||||
)
|
||||
PathRef(Task.dest)
|
||||
}
|
||||
|
||||
def resources = Task {
|
||||
super.resources() ++ Seq(scaliveBundle())
|
||||
super.resources() :+ scaliveBundle() :+ cssResources()
|
||||
}
|
||||
|
||||
object js extends TypeScriptModule:
|
||||
def mainFileName = "app.js"
|
||||
def npmDeps = Seq("phoenix@1.7.21", "phoenix_live_view@1.1.8", "topbar@3.0.0")
|
||||
end example
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue