forked from babashka/nbb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bb.edn
20 lines (20 loc) · 1000 Bytes
/
bb.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{:tasks
{:requires ([babashka.fs :as fs])
clean (fs/delete-tree "out")
compile (do (shell "npx shadow-cljs --force-spawn compile modules")
(spit "out/nbb_core.js"
(clojure.string/replace (slurp "out/nbb_core.js") (re-pattern "self") "globalThis"))
(spit "out/nbb_main.js"
(str "#!/usr/bin/env node\n\n" (slurp "out/nbb_main.js")))
(shell "chmod +x out/nbb_main.js"))
release {:depends [clean]
:task
(do (shell "npx shadow-cljs --force-spawn release modules")
(spit "out/nbb_core.js"
(clojure.string/replace (slurp "out/nbb_core.js") (re-pattern "self") "globalThis"))
(spit "out/nbb_main.js"
(str "#!/usr/bin/env node\n\n" (slurp "out/nbb_main.js")))
(shell "chmod +x out/nbb_main.js"))}
run (shell "out/nbb_main.js test.cljs")
publish {:depends [release]
:task (shell "npm publish")}}}