Leiningen plugin for managing Bower dependencies in Clojure projects
To enable lein-bower for your project, put the following in the
:plugins
vector of your project.clj
file:
Like NPM dependencies,
bower components can be installed by adding a
:bower-dependencies
key in your project.clj
:
:bower-dependencies [[bootstrap "2.3.1"]
[font-awesome "3.0.2"]
[angular "~1.0.6"]
[angular-strap "~0.7.3"]
[angular-ui "~0.4.0"]
[angular-bootstrap "~0.3.0"]]
You can specify where bower components will be installed with:
:bower {:directory "resources/public/js/lib"}
You can also specify what filenames to use for bower configuration:
:bower {:package-file "bower.json", :config-file ".bowerrc"}
Users of bower versions prior to v0.9.0 may want to set :package-file
to "component.json"
. Default filenames are bower.json
and .bowerrc
.
You can execute Bower commands that require the presence of two files
bower.json
and .bowerrc
using the lein bower
command. This command
creates temporary versions of those files based on your project.clj
before
invoking the Bower command you specify. The keys name
, description
, version
and bower-dependencies
are automatically added to bower.json
.
The key bower-directory
is automatically added to .bowerrc
.
$ lein bower install # installs project dependencies
$ lein bower ls # lists installed dependencies
$ lein bower search angular # searches for packages containing "angular"