12345678910111213141516171819202122232425262728293031323334353637383940 |
- # Package
- version = "0.1.0"
- author = "NerdRat"
- description = "A template to build web applications using pure.css, karax and jester web framework."
- license = "GPL-3.0"
- srcDir = "src"
- bin = @["purecss_karax_nim"]
- # Dependencies
- requires "nim >= 1.0.0", "karax >= 1.1.0", "jester >= 0.4.3"
- task clean, "Clean all produced files and directories.":
- if dirExists("public"):
- rmDir("public")
-
- if fileExists(bin[0]):
- rmFile(bin[0])
- if fileExists("assets"):
- rmFile("assets")
- task getAssets, "Install external frontend assets.":
- echo "Getting external assets..."
- exec "nimble c src/assets.nim -d:ssl -o:./assets"
- exec "./assets"
- echo "Downloaded assets..."
- task buildFrontend, "Build frontend files.":
- echo "Building frontend..."
- if not dirExists("public"):
- getAssetsTask()
- # Build frontend files in src dir.
- exec "nimble js --o:public/js/app.js src/client/index.nim"
- before build:
- buildFrontendTask()
|