NAME Mojolicious::Plugin::AssetPack - Compress and convert css, less, sass and javascript files VERSION 0.0401 SYNOPSIS In your application: use Mojolicious::Lite; plugin AssetPack => { rebuild => 1 }; # add a preprocessor app->asset->preprocessors->add(js => sub { my($assetpack, $text, $file) = @_; $$text = "// yikes!\n" if 5 < rand 10; }); # define assets: $moniker => @real_assets app->asset('app.js' => '/js/foo.js', '/js/bar.js'); app->asset('app.css' => '/css/foo.less', '/css/bar.scss', '/css/main.css'); app->start; In your template: %= asset 'app.js' %= asset 'app.css' See also "register". DESCRIPTION Production mode This plugin will compress scss, less, css and javascript with the help of external applications on startup. The result will be one file with all the sources combined. This file is stored in "Packed directory". The files in the packed directory will have a checksum added to the filename which will ensure broken browsers request a new version once the file is changed. Example: