Lein-cljsbuild source-cljs dir & # 8594; output-js dir?

Looking at cljsbuild doc https://github.com/emezeske/lein-cljsbuild

:cljsbuild { :builds [{ ; The path to the top-level ClojureScript source directory: :source-paths ["src-cljs"] :compiler { :output-to "war/javascripts/main.js" ; default: target/cljsbuild-main.js 

this requires

: source paths as directory

: output-to as js file

Why not source dir β†’ output dir ??

How can we manage many source files to compile many output files?

Is there any configuration to display * .cljs @sourceDir -> * .js @targetDir?

+4
source share
3 answers

You can get multiple output files, just use multiple assemblies

Remember that the code is designed to work with the Google Closure compiler, which not only reduces the number of files to 1 (which is more effective for downloading by the browser), but also removes huge redundancy in the code. It also ensures that files are downloaded in the correct order.

If you do not want to embed, you can set the :optimizations option to :none (compared to :whitespace :simple or :advanced ). This can help you get closer to making sure that you check the target directory for temporary files that may be what you are after.

+4
source

I can not speak for the author, but I assume that this is due to two things.

  • Having one output makes things like cljsbuild auto more manageable.

  • Ok, I see a limited use case for multiple input paths, multiple output files seem to run counter to browser performance? Where you basically want one highly optimized .js file for optimal download speed.

If you need multiple .js files from multiple .cljs collections that are not actually connected, this is essentially a different project.

+1
source

You still need: output-to, but I think you're looking for the option : output-dir .

0
source

Source: https://habr.com/ru/post/1489816/


All Articles