NAME
Mojolicious::Plugin::AssetPack::Pipe::Reloader - Automatically reload assets in browser
SYNOPSIS
Application
$app->plugin(AssetPack => {pipes => ["Reloader"]);
Template
%= asset "reloader.js" if app->mode eq "development"
DESCRIPTION
Mojolicious::Plugin::AssetPack::Pipe::Reloader is a pipe which will create an asset called "reloader.js". This asset will automatically reload the page in the browser when one of the assets change on disk. This is done without the need of morbo.
This feature is EXPERIMENTAL, UNSTABLE and only meant to be used while developing.
ENVIRONNMENT
MOJO_ASSETPACK_RELOAD_STRATEGY
The environment variable MOJO_ASSETPACK_RELOAD_STRATEGY
can either be set to "document" or "inline". "document" means that the whole document should reload when an asset change, while "inline" will try to figure out which "link" and "script" tags that changed and only reload those.
The default is "document" for now, but this might change in the future.
METHODS
new
Used to add a special "reloader.js" asset and a "/mojo-assetpack-reloader-ws" WebSocket endpoint.
process
This method does nothing.