Ryan Lang


Web::AssetLib - Moose-based pluggable library manager for compiling and serving static assets


version 0.042


Create a library for your project:

        package My::Library;

        use Moose;

        extends 'Web::AssetLib::Library';

        sub jQuery{
                return Web::AssetLib::Asset->new(
                type         => 'javascript',
                input_engine => 'LocalFile',
                rank         => -100,
                input_args => { path => "your/local/path/jquery.min.js", }


Compile assets from that library:

        use My::Library;

        # configure at least one input and one output plugin
        # (and optionally, a minifier plugin)
        my $lib = My::Library->new(
                input_engines => [
                search_paths => ['/my/assets/root/']
                output_engines => [
                                output_path => '/my/webserver/path/assets/'

        # create an asset bundle to represent a group of assets
        # that should be compiled together:

        my $homepage_javascript = Web::AssetLib::Bundle->new();

        # compile your bundle
        my $html_tag = $lib->compile( bundle => $homepage_javascript )->as_html;


Web::AssetLib allows you to build an easy-to-tweak input -> (minfiy) -> output pipeline for web assets, as well as a framework for managing those assets.

You have the option to compile groups of assets, or individual ones. Out of the box, Web::AssetLib supports local file, remote file, and string inputs, minification with CSS::Minifier and JavaScript::Minifier, and local file output.

Possibilities for future plugins: Amazon S3 output, other CDN outputs, SASS input, etc.

This documentation uses method signature notation as defined by Method::Signatures.


Basic usage is covered in Web::AssetLib::Library.

The following base classes are provided for extendability:

The following objects are used to define assets or groups of assets:

Plugins provided by default:


Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker at https://github.com/ryan-lang/Web-AssetLib/issues. You will be notified automatically of any progress on your issue.

Source Code

This is open source software. The code repository is available for public review and contribution under the terms of the license.


  git clone https://github.com/ryan-lang/Web-AssetLib.git


Ryan Lang <rlang@cpan.org>