Using cljsbuild, I can compile all my .cljs files to one file. However, I wish to be able to pick a directory for output and have each .cljs file compile into its own .js file. How can this be specified?
You can use 'multiple build configurations': cljsbuild accepts a vector of configurations for :builds
key, each element of which defines rules for compiling separate .js file (more info could be found in lein-cljsbuild README). Simple example:
:cljsbuild
{:builds
[;; Config for first .js file
{:source-paths ["dir-with-cljs-for-first-js"]
:compiler {:output-to "dir-for-js/first.js"}
;; Config for second .js file
{:source-paths ["dir-with-cljs-for-second-js"]
:compiler {:output-to "dir-for-js/second.js"}}]}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With