Plack::Middleware::File::Less - compile LESS templates into CSS stylesheets
use Plack::App::File; use Plack::Builder; builder { mount "/stylesheets" => builder { enable "File::Less"; Plack::App::File->new(root => "./stylesheets"); }; }; # Or with Middleware::Static enable "File::Less"; enable "Static", path => qr/\.css$/, root => "./static";
Plack::Middleware::File::Less is middleware that compiles Less templates into CSS stylesheet..
When a request comes in for .css file, this middleware changes the internal path to .less in the same directory. If the LESS template is found, a new CSS stylesheet is built on memory and served to the browsers. Otherwise, it falls back to the original .css file in the directory.
If you have the lessc executable available in your PATH, this module automatically uses the command to convert LESS into CSS. If the command is not available and you have CSS::LESSp perl module available, it will be used. Otherwise you'll get an exception during the initialization of this middleware component.
lessc
Plack::App::File CSS::LESSp http://lesscss.org/
Naoya Ito <lt>i.naoya@gmail.com<gt>
Franck Cuny <lt>https://github.com/franckcuny<gt>
Tatsuhiko Miyagawa <lt>miyagawa@bulknews.net<gt>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Plack::Middleware::File::Less, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::File::Less
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::File::Less
For more information on module installation, please visit the detailed CPAN module installation guide.