Add fathom script

And fix output dir for elm compile
This commit is contained in:
Eike Kettner
2020-09-07 23:28:02 +02:00
parent eb11b33028
commit 72569287ba
7 changed files with 95 additions and 4 deletions

View File

@ -75,7 +75,7 @@ object ZolaPlugin extends AutoPlugin {
Seq("--base-url", url)
case None =>
runYarnInstall("yarn", inDir.getParentFile, logger)
runElmCompile("elm", inDir.getParentFile, outDir, logger)
runElmCompile("elm", inDir.getParentFile, inDir, logger)
Seq.empty
}
Cmd.run(
@ -91,13 +91,13 @@ object ZolaPlugin extends AutoPlugin {
def runYarnInstall(yarnCmd: String, inDir: File, logger: Logger): Unit =
Cmd.run(Seq(yarnCmd, "install"), inDir, logger)
def runElmCompile(elmCmd: String, inDir: File, zolaOut: File, logger: Logger): Unit =
def runElmCompile(elmCmd: String, inDir: File, zolaRoot: File, logger: Logger): Unit =
Cmd.run(
Seq(
elmCmd,
"make",
"--output",
(zolaOut / "static" / "js" / "bundle.js").absolutePath.toString,
(zolaRoot / "static" / "js" / "bundle.js").absolutePath.toString,
"--optimize",
(inDir / "elm" / "Main.elm").toString
),