Boot-cljs does some special handling with some of ClojureScript compiler options, these cases are either related to Boot temp dir and fileset architecture, or to support some additional features of Boot-cljs.
Example of first case is :output-to and :output-dir. These filepaths need to
be under temp directory managed by Boot-cljs.
Example of second case is :main namespace. Boot-cljs writes it's own main namespace
because we need to support multiple :require namespaces from .cljs.edn files. This
is important because other tools (boot-reload)
use :require to initialize themselves.
:compiler-options in .cljs.edn file:compiler-options task option:optimizations and :source-map task options:output-dir, :output-to, :main)TODO: add support for merging :closure-defines and other map options #135
:output-dir & :output-toIf these options are set, path of Boot-cljs temp dir is prepended into these.
If values are not set, default value is created based on relative path of the .cljs.edn file.
resources/js/main.cljs.edn
:resource-paths #{"resources"}js/main.cljs.edn:output-dir is set to js/main.out:output-to is set to js/main.js:mainThis value is always set to namespace generated by Boot-cljs, e.g. boot.cljs.main31649,
where the number is generated with gensym.
If user provides :main option, the namespace is appended to :require .cljs.edn
option, and is thus required by the Boot-cljs main namespace. This should usually
work nearly the same as without Boot-cljs main namespace, but this keeps the support
for Boot-reload and others to use :require.
Note: It would be possible for Boot-reload to use :preloads instead of :require, but
that would change the loading order and cause problems with current implementation
of Boot-reload (check #143 for some
information.)
:source-mapThis option can be provided task option or as compiler-option. If :optimizations is
not :none and :modules is not used, :source-map is automatically set to
:output-to with .map prepended.
:modulesShould work similar to :output-to. If user provides a value, it is prepended with
path to Boot-cljs temp dir, else default value is created based on relative path of .cljs.edn
file and name of the module.
:output-wrapperWhen doing :optimization :advanced build, if :output-wrapper is nil it is set enabled. This follows Lein-cljsbuild.
See more: #64
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |