nilo de roock
nilo de roock

Reputation: 4157

What is the purpose of :hooks [leiningen.cljsbuild] in a Leiningen project.clj file?

I have been looking at several project templates for a Clojure/ClojureScript web application. Some have the following line in the Leiningen project.clj

 :hooks [leiningen.cljsbuild]

while others have not.

What is the purpose of this line? Why would you use it, and why not? Are there advantages, or disadvantages in using this?

Upvotes: 1

Views: 578

Answers (1)

Piotrek Bzdyl
Piotrek Bzdyl

Reputation: 13185

:hooks option is used for modifying built-in Leiningen tasks. All the details are described in Leiningen's documentation.

leiningen.cljsbuild hooks are adding ClojureScript support in lein's built-in tasks: compile, test, jar.

It might be useful if your project contains both Clojure and ClojureScript files. By using the hook you can compile, test or package them in jar in one run using lein's built-in tasks instead of calling them separately for Clojure (built-in tasks) and ClojureScript with lein-cljsbuild tasks.

Upvotes: 2

Related Questions