montoux / lein-less

Less css compiler plugin for the leiningen (clojure) build tool
Eclipse Public License 1.0
38 stars 15 forks source link

Allow src-paths to refer to individual less files #16

Open bbbates opened 9 years ago

bbbates commented 9 years ago

It can be useful to ensure that only a single less file (usually a "root" less file that contains a large amount of @imports) is compiled, rather than all less files in a path and it's descendents.

This can actually be a workaround for #9 (that @tangrammer eluded to); instead of having the bootstrap less failures fail the build, only build a single (or multiple) "root" less files like thus:

src/less/my-css.less:

@import bootstrap/bootstrap.less
@import some-other-file.less

project.clj

  :less {:source-paths ["src/less/my-css.less"]
           :target-path "resources/public/css"}

I also added a change to ensure that the auto task watches the parent directory of any less files specified in src-paths - which isn't ideal, but will at least force a recompile of the src less file if something changes thats likely to affect the file.

jacobemcken commented 8 years ago

I noticed that if I prefixed the name with an _ (underscore), then the Less files wouldn't be compiled into CSS files. That might be another possible workaround... at least it was for me.

leonfs commented 8 years ago

The underscore trick worked for me too.