logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Guide

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

       • MOJO_ASSETPACK_DEBUG

         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.

       • MOJO_ASSETPACK_LAZY

         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.

   Fasterdevelopmentcycle
       For a faster development cycle, you can use 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

   Enforcingproductionassets
       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 "MOJO_ASSETPACK_LAZY".

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

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

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

         done_testing;

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

Name

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

Optional Modules

       There are some optional modules you might want to install:

       • CSS::Minifier::XS

         Used by Mojolicious::Plugin::AssetPack::Pipe::Css.

       • CSS::Sass

         Used by Mojolicious::Plugin::AssetPack::Pipe::Sass.

       • IO::Socket::SSL

         Required if you want to download assets served over SSL.

       • JavaScript::Minifier::XS

         Used by Mojolicious::Plugin::AssetPack::Pipe::JavaScript.

Overview

       This guide will provide a setup for effective development with Mojolicious::Plugin::AssetPack.

See Also

       Mojolicious::Plugin::AssetPack,           Mojolicious::Plugin::AssetPack::Guides::Cookbook            and
       Mojolicious::Plugin::AssetPack::Guides::Tutorial.

perl v5.40.0                                       2024-12-07             Mojolicious::Pl...des::Developing(3pm)

See Also