softprops / less-sbt Goto Github PK
View Code? Open in Web Editor NEWtype less css in your sbt projects
License: Other
type less css in your sbt projects
License: Other
Hi!
Have you ever tried to use latest.integration
as version for less-sbt
plugin in tests?
latest.integration
is ivy's special revision name. Check this for more info.
I would like to force compilation even when I have css files in my folder is that possible ?
use one instance of the compiler per sbt session. ala the recent change contributed in the coffeescripted plugin
It doesn't look like it from my investigating, but I just wanted to make sure. There isn't a way to have this output both a regular css and minified css file is there? And if not, is this something you would consider putting in?
Thanks for your time, consideration, and plugin!
Im trying to use the latest version of the plugin and after compiling css i just get under resource_managed/main/css a .css file with output 'null'.
Hi
When looking under http://dl.bintray.com/content/sbt/sbt-plugin-releases I could not locate version 0.2.2 as described on the landing page for the project.
Is it deployed or did I misunderstand the instructions?
I'm using Scala 2.10.3 and SBT 0.13.0
Hi!
Since today i can't do less task. I get such error:
[info] Compiling 1 less sources to /home/kastigar/.../target/scala-2.9.1/resource_managed/main/css
[error] {file:/home/kastigar/.../}default-bbdc92/compile:less: error occured while compiling /home/kastigar/.../src/main/less/main.less: ReferenceError: "print" is not defined. (less-rhino-1.1.3.js#2420)
I don't know what was changed (i don't remember when i have last recompilation of my less files).
use one instance of the compiler per sbt session. ala the recent change contributed in the coffeescripted plugin
Heya, Doug.
You should nudge your constituents to add the bintray resolver to their builds. I'm worried lest they would not be able to resolve lesst otherwise. Unlesst you mean to publish lesst on a central repository.
resolvers += "softprops-maven" at "http://dl.bintray.com/content/softprops/maven"
Regards,
Marko
Some times I wanna use less outside the context of and sbt project. This could be conscripted but the sbt specfic deps need factored out.
If you change a less file the plugin correctly recompiles it, but if another less file imports it then that file also needs to be recompiled to include the changes in the file it imports.
I'll guess that dependency checking might be hard but possibly there could be an option added to compile all less files when one file changes.
Hi!
There is such file structure:
less/
|-lib/
| |-- lib.less
| |-- sub.less
| -- main.less
main.less:
@import "lib/lib.less"
lib/lib.less:
@import "sub.less"
This doesn't work. Somehow while importing sub.less in lib.less it searches for sub.less instead of lib/sub.less. Browser version of lesscss works fine.
When executing "less", the filter
and excludeFilter
settings are never used. I want to do something like this:
lazy val lessSettings = LessPlugin.lessSettings ++ Seq(
LessKeys.filter in (Compile, LessKeys.less) := ("*.less" - "*.lib.less"))
But also all files with *.lib.less
are include when executing "less".
I'm trying to change where the css
files are compiled to in my build.sbt
file. For the CoffeeScriptedSbt plugin I can do this with a line like:
(targetDirectory in Coffee) <<= (crossTarget in Compile)(t => t / "webapp_managed" / "js")
This works fine.
With less-sbt I appear to have to write:
(targetDirectory in LessKeys.less) <<= (crossTarget in Compile)(t => t / "webapp_managed" / "css")
whilst this seems to change the setting, in that target-directory(for less)
from the sbt prompt gives the right result, the less command nevertheless appears to compile to the same place as it did before.
On the other hand, I find configuration in sbt to be a process of trail and error so I could be doing completely the wrong thing here.
Hi,
I encountered a problem with the less minifier.
I set (LessKeys.mini in (Compile, LessKeys.less)) := true
in my build definition (after including the lessSettings).
When I type less::mini into SBT-console, it get the result [info] true
But yet the compiled CSS isn't minified at all.
Apparently there is no difference in the compile CSS, whether mini is true or false.
How is the minifier supposed to work?
I'm using sbt.version = 0.13.0 and less-sbt 0.2.1
Cheers,
Max.
I haven't looked to heavily into this, but when I try to compile only the bootstrap sources (via "bootstrap.less") using the filter as described, the resulting main.css file is empty. Wondering if there is something specific about the latest version of Bootstrap that isn't being handled correctly (maybe imports?).
Hi!
We have one root less source for internal part of the site and other one for public part.
With LessKeys.filter
as I understand it is possible to list only one file.
Is it possible to compile multiple root sources?
When updating bootstrap to 2.3.2 I get a compile error in sbt. The cause of the error is the mixins.less
file from Bootstrap 2.3.2, that contains a new code structure which I think cannot be compiled by the current LESS compiler in less-sbt. The root cause of the compiler error is the following commit/change in bootstrap:
Here a demo project that reproduces the problem and documents the error I get.
https://github.com/rudolfb/test_bootstrap_2.3.2_compile_error
https://github.com/rudolfb/test_bootstrap_2.3.2_compile_error.git
I hope you are the correct person to post this issue to. Please feel free to ask should you have any questions.
F.Y.I: I am new to scala, lift, less, sbt et al. If this does not have anything to do with less-sbt I would appreciate if you could tell me whom to contact to have this looked at. It might even be an error on my side in my project that I am not capable to see yet.
Regards
Rudolf
I'm confused about where to find the current artifacts:
Where would I find 0.1.5, 0.1.6 and 0.1.7 ?
Doug,
I have a strange issue that is preventing me from upgrading from 0.1.5 to 0.1.6:
I run less-sbt with only one custom setting:
// have less-sbt compiled templates merged right in with our other resources
resourceManaged in (Compile, LessKeys.less) <<= resourceManaged in Compile
With 0.1.5 my JS artifacts all eventually land in target/scala-2.9.1/classes were my application expects them. With 0.1.6 however they stay in target/scala-2.9.1/resource_managed and don't get copied over to .../classes.
What has changed between these versions to cause this difference in behavior?
How can achieve the previous behavior with 0.1.6?
Cheers,
Mathias
the compiler should be design this way
Is it possible to compile severeal css files from different sources?
One example:
error evaluating function `darken`
less-sbt could show the values of the properties filename
, line
, column
, and extract
from the javascript exception for a little more context.
I don't blame it on less-sbt, not at all. Looking at the less issue tracker it seems that less has soooo many unsolved problems. Than looking at the less code it seems they just don't have any proper error reporting in situations like this. Then looking at rhino it seems they don't even manage to put apidocs on the web. Oh yes.
It would be useful if the "compile" would recompile less instead of having to do a separate "less" task. This way one can do "~compile" while doing development to get continuous compilation regardless of whether one is editing .less files or .host-language files.
Great plugin... but I'm having trouble with imports.
I have two files thus:
baseline.less
forms.less
Baseline declares a variable @baseline and imports forms with @import "forms.less";
less-sbt compiles baseline.less just fine.
But then immediately afterwards, less-sbt tries to compile forms.less which has no reference to @baseline and it tanks.
Lift/compile:less: error occured while compiling /less/forms.less: variable @baseline is undefined
I tried moving the imports to another dir and rereferencing, but then baseline won't compile. Is there a way to exclude compilation of imports?
A great project to try this on is twitter bootstrap.
Thanks!
Hello. I am using less-sbt version 0.1.10.
In such less file (UTF-8) i use:
cite{
font-style: italic;
float: right;
font-size: 11px;
&:before{
content: "— ";
}
}
I used unicode EM DASH http://www.fileformat.info/info/unicode/char/2013/index.htm
As a result i got such css (also in UTF-8):
cite:before{content:"вАФ ";}
In my boot only this about less plugin:
(LessKeys.mini in (Compile, LessKeys.less)) := true
(excludeFilter in (Compile, LessKeys.less)) := "_*"
Please update less-sbt to support the latest version of lesscss.
This output appears a lot.
> compile
[info] No less files to compile
[info] No less files to compile
[success] Total time: 0 s, completed Nov 9, 2011 3:52:13 PM
> less
[info] Compiling 1 less files to /.../webapp/css
[success] Total time: 1 s, completed Nov 9, 2011 3:52:17 PM
The above output is interesting because less-sbt
is stating that there are no less files to compile while doing a compile
task. But compiling isn't compiling less files at the moment (though it would be nice if it did). However, when I then type in the less
task you can see that there were less files to compile.
Thanks for this and the coffeescripted-sbt plugins by the way!
Probably because last rhino compatible less version is less than the latest official less version. Not nice. Need the bugfixes...
I set up less-sbt with the minimal configurations and I keep getting this compile error:
compile:less: Error occured while compiling C:...\src\main\less\main.less: Method "doctest" not found in "org.mozilla.javascript.tools.shell.Global". (compiler.scala#39)
What I did was add this to my build.sbt:
seq(lessSettings:_*)
and added this to project/plugins.sbt:
addSbtPlugin("me.lessis" % "less-sbt" % "0.1.10")
resolvers += Resolver.url("sbt-plugin-releases",
new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(
Resolver.ivyStylePatterns)
I also tried 0.1.9 with no avail.
The only thing in the less folder is the main.less file, which just had this:
@color: #4D926F;
color: @color;
}
I also tried making main.less into an empty file, with no avail :(
This is not at all an issue, but rather a question - couldn't find a more proper place to ask…? I'm a maven guy and kind of new to sbt so please bare with me if my question is obvious.
So, I would like to have my .less files live under /src/main/less and then be compiled to .css under some "generated" output - definitely not under src/main/webapp. I would then have this built into my war at the correct place as well as served by an embedded jetty using xsbt-webapp-plugin. What I have is the following:
seq(lessSettings:_*)
// Only main file (imports the others)
(LessKeys.filter in (Compile, LessKeys.less)) := "bootstrap.less"
// minify
(LessKeys.mini in (Compile, LessKeys.less)) := true
webappResources in Compile <+= (crossTarget in Compile)(_ / "resource_managed" / "main")
So the last line here I added to make xsbt-web-plugin bake the compiled css into the webapp. However, I see 2 problems with this:
webappResources in Compile <+= (crossTarget in Compile)(_ / "resource_managed" / "main" / "css")
my css is put straight under context root and I want /css/bootstrap.css for example.
~/temp/ $ tar -tf example.war | grep css
WEB-INF/classes/css/
css/
css/bootstrap.css
WEB-INF/classes/css/bootstrap.css
Are there any easy ways to achieve what I want? I figured this was the place to ask even though I guess the answer might be in settings of the web-plugin.
Thanks,
Viktor
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.