Duct module for configuring a ClojureScript compiler.
After adding the dependency add the following key to your config.edn
module configuration:
:dev.gethop.duct.module/cljs-compiler {}
The module accepts a :environments
key which is a map with multiple
environments configuration (dev, test, prod, etc.). Each environment
has a mandatory key :compiler
and a optional key
:compiler-config
. The former is the compiler you want to use for the
given environment, and the latter is the configuration for the
compiler.
Currently the module supports two compilers:
The module already provides a default configuration that is sensible
enough for a development (using figwheel
) and a production (using
closure-compiler
).
Here is a sample configuration:
:dev.gethop.duct.module/cljs-compiler
{:environments {:development {:compiler :figwheel-main
:compiler-config {:options {:main foo.client}}}
:production {:compiler :closure-compiler
:compiler-config {:build-options {:main foo.client :infer-externs true}}
Bear in mind that each :compiler-config
is specific to the
:compiler
technology. So please refer to their documentation to view
all the possible configuration options.
Copyright (c) 2024 Biotz, SL.
The source code for the library is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.