Comments (2)
Hi @sroebuck. Thanks for trying out the plugin. You are almost there :)
First, a quick note on best practices.
You should be noticing a change in how newer sbt plugins are developed and how keys are exposed. The collective plugin community and (with Marks input) have decided on a new design based on best practices.
The old design used configs for namespaces which was kind of bastardizing what configs are for. So you should see less of this
myplugin:mykey
and more of
somekey(for someTaskKey)
While I agree thats less than ideal you should start seeing a new repl syntax for task dependent keys in upcoming sbt releases.
Another part of the best practices doc is on reusing exisiting keys. There is no targetDirectory
in the less plugin but there is a resourceManaged
key defined by sbt but scoped to the less task. Checkout the readme for a full list of keys I use.
Keys are also used within provided scopes rather than custom scopes now. Below is want you want to use
In your build file, add
(resourceManaged in (Compile, LessKeys.less)) <<= (crossTarget in Compile)(_ / "webapp_managed" / "css")
which should result in the following repl behavior
> compile:resource-managed(for less)
[info] /Users/dougtangren/Desktop/tests/lesstest/target/scala-2.9.1/webapp_managed/css
> less
[info] Compiling 2 less files to /Users/dougtangren/Desktop/tests/lesstest/target/scala-2.9.1/webapp_managed/css
[success] Total time: 1 s, completed Oct 2, 2011 7:46:36 PM
Since changing the default location or where less css files are written to is probably a common question I'll add that to the readme as well.
Have fun!
from less-sbt.
Just wanted to thank for the explanation, and confirm that the following combo is now working perfectly:
temporaryWarPath <<= (sourceDirectory in Compile)(_ / "webapp"),
(resourceManaged in (Compile, LessKeys.less)) <<= webappResources(_.get.head / "static" / "less")
from less-sbt.
Related Issues (20)
- Compiled JS artifacts not available anymore in 0.1.6 HOT 4
- Make clear what repository holds the artifact HOT 12
- Error messages are less than ideal HOT 4
- Version number of less in less-sbt less than official less version HOT 7
- Can't force less recompilation HOT 7
- try/catch is a poor design idiom. prefer either HOT 1
- factor out compiler wrapper HOT 1
- Compile Error: Method "doctest" not found in "org.mozilla.javascript.tools.shell.Global" HOT 9
- Problems using with xsbt-web-plugin…
- Unicode symbols HOT 7
- lesscss 1.3.3 support HOT 2
- Compile error when updating to Bootstrap 2.3.2 HOT 11
- Multiple root sources HOT 2
- Not working for Bootstrap 3.0 ? HOT 9
- lesst dependency not available HOT 2
- CSS output file contains just 'null' HOT 11
- Minifier doesn't work HOT 2
- Version in instruction on landing page is not deployed? HOT 2
- Regular and minified output HOT 1
- Multiple css files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from less-sbt.