Mojolicious::Plugin::Text::Minify - remove HTML indentation on the fly
version v0.2.4
# Mojolicious::Lite plugin "Text::Minify"; # Mojolicious $app->plugin("Text::Minify");
This plugin uses Text::Minify::XS to remove indentation and trailing whitespace from HTML content.
If the mojox.no-minify key in the stash is set to a true value, then the result will not be minified.
mojox.no-minify
You can also use of the minifier conditional on the application mode
plugin 'Text::Minify' if app->mode eq "production";
Note that this is naive minifier which does not understand markup, so newlines will still be collapsed in HTML elements where whitespace is meaningful, e.g. pre or textarea.
pre
textarea
This module requires Perl v5.16, which is the same minimum version that the current version of Mojolicious requires.
Future releases may only support Perl versions released in the last ten years.
Text::Minify::XS
Plack::Middleware::Text::Minify
The development version is on github at https://github.com/robrwo/Mojolicious-Plugin-Text-Minify and may be cloned from git://github.com/robrwo/Mojolicious-Plugin-Text-Minify.git
Please report any bugs or feature requests on the bugtracker website https://github.com/robrwo/Mojolicious-Plugin-Text-Minify/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Robert Rothenberg <rrwo@cpan.org>
This software is Copyright (c) 2021-2023 by Robert Rothenberg.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Mojolicious::Plugin::Text::Minify, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::Text::Minify
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::Text::Minify
For more information on module installation, please visit the detailed CPAN module installation guide.