NAME Mojolicious::Plugin::AssetPack - Compress and convert css, less, sass, javascript and coffeescript files VERSION 0.17 SYNOPSIS In your application: use Mojolicious::Lite; plugin 'AssetPack'; # define assets: $moniker => @real_assets app->asset('app.js' => '/js/foo.js', '/js/bar.js', '/js/baz.coffee'); app->asset('app.css' => '/css/foo.less', '/css/bar.scss', '/css/main.css'); # you can combine with assets from web app->asset('bundle.js' => ( 'http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.3.0/es5-shim.js', 'http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.3.0/es5-sham.js', 'http://code.jquery.com/jquery-1.11.0.js', '/js/myapp.js', )); app->start; In your template: %= asset 'app.js' %= asset 'app.css' Or if you need to add the tags manually: % for my $asset (asset->get('app.js')) { %= javascript $asset % } See also "register". ENVIRONMENT MOJO_ASSETPACK_NO_CACHE If true, convert the assets each time they're expanded, instead of once at application start (useful for development). Has no effect when "minify" is enabled. DESCRIPTION Production mode This plugin will compress scss, less, css, javascript and coffeescript 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: