SomMeri / less4j

Less language is an extension of css and less4j compiles it into regular css. Less adds several dynamic features into css: variables, expressions, nested rules, and so on. Less was designed to be compatible with css and any correct css file is also correct less file.
146 stars 47 forks source link

Compile multiple less files and merge their source maps to point back to their original file #234

Closed SeabassNg closed 10 years ago

SeabassNg commented 10 years ago

Hi,

I was wondering if less4j can currently compile multiple less files together and then merge their source maps together to point back to the original line in the less files. Currently, it looks like if I combine the css output with the maps inlined, the browser is only looking at the last source map.

martin-g commented 10 years ago

Yes. Create a main .less file that imports all other less files and pass it to the compiler.

SeabassNg commented 10 years ago

Ah! Very brilliant idea!

Currently, I'm trying to use the String version of the compile method put all the imports into a string to be compiled, but it looks like it doesn't know where to find the files. Is there any way to set the base url to find those files?

SeabassNg commented 10 years ago

Actually, nvm. I managed to cobbled together a couple of classes that extends Abstract Hieracharchial Source class. Unfortunately, I'm now running into a Out of memory error, so need to figure out a way to lazy load the CSS

SomMeri commented 10 years ago

Closing this as answered. If you have more questions, feel free to re-open or create new issue.