Closed dwightwatson closed 10 years ago
@dwightwatson Thanks. I've been meaning to try out some new minifiers as the existing ones seem to cause some issues. It would be nice to find a minifier that just throws an exception or something then I might just do this in the AssetPipeline CssMinifierFilter
// $code is the unminified code
try {
return $minifier->minify($code);
} catch(MinifierException $e) {
}
// failed to minify so just return regular code instead...
return $code;
Well, I tried that plugin out and it didn't work. So back to the old one.
@kdocki What type of issues were you seeing with the new less.php plugin? Not sure if you saw on less.php's readme, but they have an adapter that lets you easily transition from the current package you're using with no additional changes. I tested out just swapping the require value out for the new package in composer.json
and it seemed to work fine for me with no additional changes and I can now compile Bootstrap 3.1 with asset-pipeline.
https://github.com/briankiewel/asset-pipeline/commit/bd725df55ea5ed87deea588863655ab0147d4fa6
@briankiewel I saw that. One of the issues was that it wasn't scoping correctly... so for example if you did @import colors.less
it wouldn't find it because it didn't know where to look. So if I setup the importDirs ... it still didn't work. You are welcome to do a pull request if you'd like...
@kdocki Weird, the code below is working for me with just the composer.json
switch.
@import 'colors-samedir.less';
@import 'subdir/colors-subdir.less';
body {
color: @base;
}
p {
color: @foo;
}
I'll definitely submit a PR, just don't want to if I'm missing something that's breaking for others.
less.php is a relatively new option for compiling LESS using PHP. Seeing as the existing
lessphp
is having issues compiling newer versions of Bootstrap, it may be worth adding an option to useless.php
as it is said to support newer versions of LESS and Bootstrap. Furthermore, it might be a suitable default replacement forlessphp
.