Reputation: 2082
I am currently newbie in Leiningen project. I want to compile less to css using lein-less
and minify-assets
on the fly so I found that I should use lein less auto
for the less file and lein minify-assets watch
for javascripts and HTML file.
I am using lein-cascade
to operate them but it just still on the lein less auto
task and not go to lein minify-assets watch
This is my project code
(defproject indecorlein "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:plugins [[lein-asset-minifier "0.4.3"]
[lein-less "1.7.5"]
[lein-cascade "0.1.2"]]
:min-lein-version "2.5.0"
:cascade {
"lessc" [["less" "auto"]]
"min" [["minify-assets" "watch"]]
"amp" ["lessc" "min"]
}
:less {:source-paths ["dev/resources/less"]
:target-path "dev/resources/css"}
:minify-assets [
[:html {:source "dev/resources/html" :target "dev/minified/html"}]
[:css {:source "dev/resources/css" :target "dev/minified/css/styles.min.css"}]
[:js {:source ["dev/res/js"] :target "dev/minified/js/amp.min.js"}]])
Maybe there's a solution about this or me just run the tasks on separate terminal tabs.
Upvotes: 0
Views: 171
Reputation:
You can use lein-pdo
plugin. Add it into your plugins and define an alias:
:plugins [...
[lein-pdo "0.1.1"]]
:aliases {"watch" ["pdo" ["less" "auto"]
["minify-assets" "watch"]]}
Then you can run lein watch
which will run both tasks at the same time.
Upvotes: 1
Reputation: 6509
The problem is that both lein less auto
and lein minify-assets watch
do not return. I've used lein less auto
in the past in a console on its own.
Upvotes: 0