purecss_karax_nim.nimble 981 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Package
  2. version = "0.1.0"
  3. author = "NerdRat"
  4. description = "A template to build web applications using pure.css, karax and jester web framework."
  5. license = "GPL-3.0"
  6. srcDir = "src"
  7. bin = @["purecss_karax_nim"]
  8. # Dependencies
  9. requires "nim >= 1.0.0", "karax >= 1.1.0", "jester >= 0.4.3"
  10. task clean, "Clean all produced files and directories.":
  11. if dirExists("public"):
  12. rmDir("public")
  13. if fileExists(bin[0]):
  14. rmFile(bin[0])
  15. if fileExists("assets"):
  16. rmFile("assets")
  17. task getAssets, "Install external frontend assets.":
  18. echo "Getting external assets..."
  19. exec "nimble c src/assets.nim -d:ssl -o:./assets"
  20. exec "./assets"
  21. echo "Downloaded assets..."
  22. task buildFrontend, "Build frontend files.":
  23. echo "Building frontend..."
  24. if not dirExists("public"):
  25. getAssetsTask()
  26. # Build frontend files in src dir.
  27. exec "nimble js --o:public/js/app.js src/client/index.nim"
  28. before build:
  29. buildFrontendTask()