Skip to content

Commit

Permalink
Use figwheel-main
Browse files Browse the repository at this point in the history
  • Loading branch information
jtkDvlp committed Apr 20, 2024
1 parent 979d513 commit 966a2dc
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ pom.xml.asc
/.nrepl-port
.hgignore
.hg/
*.~undo-tree~
9 changes: 9 additions & 0 deletions dev.cljs.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
^{:watch-dirs ["test" "src"]}
{:output-dir
"target/main/public/main/cljs-out"

:output-to
"target/main/public/main.js"

:main
cljs-workers.test}
52 changes: 20 additions & 32 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject jtk-dvlp/cljs-workers "1.1.2"
(defproject jtk-dvlp/cljs-workers "1.2.0-SNAPSHOT"
:description
"A clojurescript lib for performing async tasks via web workers"

Expand All @@ -14,43 +14,31 @@
:source-paths
["src"]

:clean-targets
^{:protect false}
["resources/public/js"
"target"]
:resource-paths
["target/main" "target/worker"]

:plugins
[[lein-cljsbuild "1.1.4" :exclusions [[org.clojure/clojure]]]
[lein-figwheel "0.5.0-1"]]
[[lein-ancient "0.7.0"]]

:profiles
{:provided
{:dependencies
[[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.229"]]}
[[org.clojure/clojure "1.10.0"]
[org.clojure/clojurescript "1.10.773"]
[org.clojure/core.async "1.6.681"]]}

:dev
{:dependencies
[[figwheel-sidecar "0.5.8"]
[com.cemerick/piggieback "0.2.1"]]}}

:repl-options
{:nrepl-middleware
[cemerick.piggieback/wrap-cljs-repl]}

:cljsbuild
{:builds
[{:id "test"
:source-paths ["src" "test"]
:figwheel true
:compiler {:main cljs-workers.test
:asset-path "js/test/out"
:output-to "resources/public/js/test/test.js"
:output-dir "resources/public/js/test/out" }}
{:id "worker"
:source-paths ["src" "test"]
:compiler {:main cljs-workers.test
:asset-path "js/worker/out"
:output-to "resources/public/js/worker/worker.js"
:output-dir "resources/public/js/worker/out"
:optimizations :advanced}}]})
[[com.bhauman/figwheel-main "0.2.12"]]}

:repl
{:dependencies
[[cider/piggieback "0.5.0"]]

:repl-options
{:nrepl-middleware
[cider.piggieback/wrap-cljs-repl]}}}

:aliases
{"build-worker"
["run" "-m" "figwheel.main" "-O" "advanced" "-bo" "worker"]})
1 change: 0 additions & 1 deletion resources/public/test.html

This file was deleted.

2 changes: 1 addition & 1 deletion test/cljs_workers/test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(defn app
[]
(let [worker-pool
(main/create-pool 2 "js/worker/worker.js")
(main/create-pool 2 "worker.js")

print-result
(fn [result-chan]
Expand Down
12 changes: 12 additions & 0 deletions worker.cljs.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
^{:watch-dirs ["test" "src"]}
{:output-dir
"target/worker/public/worker/cljs-out"

:output-to
"target/worker/public/worker.js"

:main
cljs-workers.test

:target
:webworker}

0 comments on commit 966a2dc

Please sign in to comment.