Plack::Middleware::Static::Minifier - serves static files and minify CSS and JavaScript
use Plack::Builder; builder { enable "Plack::Middleware::Static::Minifier", path => qr{^/(js|css|images)/}, root => './htdocs/'; $app; };
or you can cache minified content
use Plack::Builder; use Cache::FileCache; my $cache = Cache::FileCache->new(+{ cache_root => '/tmp/foo', namespace => 'namespace', default_expires_in => 60*60*24*7, }); builder { enable "Plack::Middleware::Static::Minifier", path => qr{^/(js|css|images)/}, root => './htdocs/', cache => $cache; $app; };
Plack::Middleware::Static::Minifier serves static files with Plack and minify CSS and JavaScript. This module is the subclass of Plack::Middleware::Static.
See Plack::Middleware::Static for more detail.
Plack::Middleware::Static::Minifier is hosted on github <http://github.com/bayashi/Plack-Middleware-Static-Minifier>
Dai Okabayashi <bayashi@cpan.org>
Plack::Middleware::Static, CSS::Minifier::XS, JavaScript::Minifier::XS Plack::Middleware, Plack
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install Plack::Middleware::Static::Minifier, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::Static::Minifier
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::Static::Minifier
For more information on module installation, please visit the detailed CPAN module installation guide.