Dancer::Plugin::Preprocess::Less - Generate CSS files from .less files
Dancer::Plugin::Preprocess::LESS automatically generates CSS files from Less files in a Dancer web application.
Add the plugin to your application:
Configure its settings in the YAML configuration file:
plugins: "Preprocess::Less": save: 1 paths: - css - subdir/css
Dancer::Plugin::Preprocess::Less adds support for Less files in a Dancer web application.
When a request is received for a CSS file, the plugin looks for a Less file with the same name, and transforms it into CSS. The generated CSS file may then be saved and served as a regular static file. Every time the source Less file gets modified, the corresponding CSS file is regenerated.
The available configuration settings are described below.
If set to
0, then the CSS files are generated on-the-fly with every request. If set to
1, the files are generated once and saved, then served as static files later on.
CSS files are saved in the same directory as the Less files, so the system user that the web application is running as must be allowed to write to that directory.
A list of paths to serve CSS files from. Each path is relative to the
public directory of the application.
plugins: "Preprocess::Less": paths: - css - subdir/css
The plugin first checks if the
lessc executable is available in the current PATH, and uses it as the preferred Less compiler. If
lessc is not found, the plugin tries to use the CSS::LESSp module as the fallback option. If both are not available, the plugin generates an error.
lessc is recommended, as the CSS::LESSp module only supports a subset of Less language features.
* http://lesscss.org/ - Less website
The plugin uses Ivan Drinchev's CSS::LESSp module.
Bugs / Feature Requests
Please report any bugs or feature requests through the issue tracker at https://github.com/odyniec/p5-Dancer-Plugin-Preprocess-Less/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
git clone https://github.com/odyniec/p5-Dancer-Plugin-Preprocess-Less.git
Michal Wojciechowski <firstname.lastname@example.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Michal Wojciechowski.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.