NAME Mojolicious::Plugin::AssetPack - Compress and convert css, less, sass and javascript files VERSION 0.0101 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". This is done using "process". The actual file requested will also contain the timestamp when this server was started. This is to help refreshing cache on change. Example: