A Leiningen plugin to help keep your project configuration in your project.clj
file when using shadow-cljs.
This plugin copies the configuration from a :shadow-cljs
key in project.clj
to the shadow-cljs.edn
file then executes shadow-cljs
with the args provided.
It also manages your npm
dependencies for the current project by using either:
- the
:npm-deps
and:npm-dev-deps
keys in the firstdeps.cljs
file found in the:source-paths
. If there are additional keys present, it will merge those in to yourpackage.json
; or - the
:npm-deps
and:npm-dev-deps
keys in inproject.clj
.
It will only use one of these for npm
dependencies, not both. The presence of deps.cljs
takes priority over project.clj
Option 1. is especially useful for library authors as shadow-cljs
expects
libraries to provide transitive npm
dependencies in a deps.cljs
file on
the classpath.
Instead of writing to package.json
as that may cause issues with other tooling
(such as npm
or shadow-cljs
itself) npm install --save{-dev} ...
is
executed with the list of dependencies on every run.
Put [lein-shadow "{YOUR_VERSION}"]
into the :plugins
vector of your project.clj.
This plugin requires that you have shadow-cljs in your :dependencies
as well.
The most basic command is:
$ lein shadow compile app
This utilizes the default args watch app
for shadow-cljs.
Some other possible commands are:
$ lein shadow watch app
$ lein shadow release app
- Entire configuration in
project.clj
, no package.json (see examples/lein-shadow-example) - Clojure deps in
project.clj
,package.json
used for js deps and/or other configuration (see examples/lein-shadow-example) - All deps in
project.clj
, with a custompackage.json
configuration for scripting (see examples/lein-shadow-package-alt-example) - Clojure deps in
project.clj
, with js deps in adeps.cljs
file on the source path (see examples/lein-shadow-deps-example)
In alphabetical order
Copyright © 2019 Nikola Peric
Distributed under the MIT License.