I'm having a lot of difficulty getting LESS parsing to work nicely in Laravel. I did some Googling and found Basset which seems to support LESS, and then found that it doesn't actually parse LESS. So I installed LessPHP as well to do the parsing.
Now when I try to use the world's simplest LESS file:
@red: #f00;
body {
background-color: @red;
}
It doesn't work. I get a "parse error":
ErrorException
parse error: failed at `@red: #f00; ` line: 1
Does anyone know what incredibly obvious mistake I've made here?
What I've done so far:
- Downloaded and installed Laravel
- Added
"jasonlewis/basset": "dev-master"and"leafo/lessphp": "dev-master"to composer.json - Run a
composer update - Run a
php artisan config:publish jasonlewis/basset - Edited the basset config to point to the
LessphpFilter - Edited the
vendor/jasonlewis/basset/src/Basset/Asset.phpto fix a bug in compatibility with Laravel 4.1 - Cleared application cache with
php artisan cache:clear - Tried to load the page with the above LESS code
There's a work-around for this. If you add a dummy rule to the top of the file like so:
It works.