Mojolic...eloping(3)
okay so bestie, welcome to the Mojolic...eloping(3) page β yep, a User Contributed Perl Documentation moment β and the guide itβs serving is Mojolicious::Plugin::AssetPack::Guides::Developing. Letβs get you set up π
π NAME π
Mojolicious::Plugin::AssetPack::Guides::Developing - Developing with AssetPack
πΈ OVERVIEW πΈ
This guide is gonna give you a setup for effective development with Mojolicious::Plugin::AssetPack. slay, no cap.
β¨ GUIDE β¨
π§ Environment variables π§
So you can set environment variables to change how AssetPack behaves, bestie:
MOJO_ASSETPACK_DEBUGβ Set this environment variable to get more debug output toSTDERR. Currently you can set it to a value between0and3, where3gives the most debug. periodtMOJO_ASSETPACK_LAZYβ Set this environment variable if you want to delay processing the assets until theyβre requested. This can be very useful while developing when the assets are changed frequently.
β‘ Faster development cycle β‘
For a faster development cycle, use MOJO_ASSETPACK_LAZY. This environment variable makes AssetPack only rebuild the asset thatβs in use on the current web page. itβs giving efficient:
$ MOJO_ASSETPACK_LAZY=1 morbo myapp.pl
π Enforcing production assets π
To be sure production assets are built correctly, add a unit test like the one below. This is especially important if youβre 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. fr fr
π§ Optional modules π§
There are some optional modules you might want to install:
CSS::Minifier::XSβ Used byMojolicious::Plugin::AssetPack::Pipe::Css.CSS::Sassβ Used byMojolicious::Plugin::AssetPack::Pipe::Sass.IO::Socket::SSLβ Required if you want to download assets served over SSL.JavaScript::Minifier::XSβ Used byMojolicious::Plugin::AssetPack::Pipe::JavaScript.
π SEE ALSO π
Mojolicious::Plugin::AssetPackMojolicious::Plugin::AssetPack::Guides::CookbookMojolicious::Plugin::AssetPack::Guides::Tutorial
mwah π β this page was brought to you by perl v5.42.0, dated 2024-12-12, and the Mojolic...eloping(3) manual. bye bestie π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: perl-Mojolicious-Plugin-AssetPack 2.150.0-bp160.1.11 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms