Mojolicious::Plugin::AssetPack::Preprocessors - Holds preprocessors
$self->add($extension => $cb);
Define a preprocessor which is run on a given file extension. These preprocessors will be chained. The callbacks will be called in the order they where added.
The default preprocessor defined is described under "detect".
Will add the following preprocessors, if they are available:
less
LESS extends CSS with dynamic behavior such as variables, mixins, operations and functions. See http://lesscss.org for more details.
Installation on Ubuntu and Debian:
$ sudo apt-get install npm $ sudo npm install -g less
scss
Sass makes CSS fun again. Sass is an extension of CSS3, adding nested rules, variables, mixins, selector inheritance, and more. See http://sass-lang.com for more information.
$ sudo apt-get install rubygems $ sudo gem install sass
js
Javascript is minified using JavaScript::Minifier::XS. This module is optional and must be installed manually.
EXPERIMENTAL! Not sure if this is the best minifier.
css
CSS is minified using CSS::Minifier::XS. This module is optional and must be installed manually.
$self->process($extension => $assetpack, \$text, $filename);
Will run the preprocessor callbacks added by "add". The callbacks will be called with the $assetpack object as the first argument.
$assetpack
$self->remove($extension); $self->remove($extension => $cb);
This method will remove all preprocessors defined for an extension, or just a given $cb.
$cb
Jan Henning Thorsen - jhthorsen@cpan.org
jhthorsen@cpan.org
To install Mojolicious::Plugin::AssetPack, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::AssetPack
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::AssetPack
For more information on module installation, please visit the detailed CPAN module installation guide.