=head1 NAME

Mojolicious::Plugin::AssetPack::Guides::Developing - Developing with AssetPack


This guide will provide a setup for effective development with

=head1 GUIDE

=head2 Environment variables

It is possible to set environment variables to change the behavior of AssetPack:

=over 2


Set this environment variable to get more debug to STDERR. Currently you can
set it to a value between 0 and 3, where 3 provides the most debug.


Set this environment variable if you want to delay processing the assets until
they are requested. This can be very useful while developing when the assets
are changed frequently.


=head2 Faster development cycle

For a faster development cycle, you can use L<MOJO_ASSETPACK_LAZY>. This
environment variable will make AssetPack only rebuild the asset that is in use
on the current web page.

  $ MOJO_ASSETPACK_LAZY=1 morbo myapp.pl

=head2 Enforcing production assets

To be sure that production assets are built correctly, you can add a unit test
like the one below. This is especially important if you are using

  use Test::Mojo;
  use Test::More;

  $ENV{MOJO_MODE} = "production";
  my $t = Test::Mojo->new("MyApp");

    ->element_exists(q(head link[href$="/app.css"]))
    ->element_exists(q(body script[src$="/app.js"]));


The C<element_exists()> tests should match the topics defined when defining the
different assets.

=head1 Optional modules

There are some optional modules you might want to install:

=over 2

=item * L<CSS::Minifier::XS>

Used by L<Mojolicious::Plugin::AssetPack::Pipe::Css>.

=item * L<CSS::Sass>

Used by L<Mojolicious::Plugin::AssetPack::Pipe::Sass>.

=item * L<IO::Socket::SSL>

Required if you want to download assets served over SSL.

=item * L<JavaScript::Minifier::XS>

Used by L<Mojolicious::Plugin::AssetPack::Pipe::JavaScript>.


=head1 SEE ALSO

L<Mojolicious::Plugin::AssetPack::Guides::Cookbook> and