=encoding utf8

=head1 NAME

Mojolicious::Plugin::AssetPack::Manual::Modes - How AssetPack behaves in different modes

=head1 DESCRIPTION

L<Mojolicious::Plugin::AssetPack> behaves different in "production" mode than
in "development" mode. The reason for this is that is't often easier to track
down bugs in a given file if it's not minified and crammed into one file.

=head1 MODES

=head2 Production mode

This plugin will compress sass, 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 L</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:

  <script src="/packed/app-ed6d968e39843a556dbe6dad8981e3e0.js">

This is done using L</process>.

=head2 Development mode

This plugin will expand the input files to multiple script or link tags which
makes debugging and development easier.

TIP! Make morbo watch your less/sass files as well:

  $ morbo -w lib -w templates -w public/sass

You can also set the L<MOJO_ASSETPACK_NO_CACHE|Mojolicious::Plugin::AssetPack/MOJO_ASSETPACK_NO_CACHE>
environment variable to "1" to pack your assets on each request.

=head2 Fallback

It is possible to instruct your application to load an old asset, if it fail
to generate a new asset. This is done by setting the
L<Mojolicious::Plugin::AssetPack/fallback> attribute to a true value.

L<Mojolicious::Plugin::AssetPack/add> will log the error if an old asset was
found or throw the error if unable to.

The default value is "1" in L<production mode|Mojolicious/mode>.

This feauture is EXPERIMENTAL. Feedback wanted.

=head1 AUTHOR

Jan Henning Thorsen - C<jhthorsen@cpan.org>

=cut
