2017 © Pedro Peláez
 

library html-minify

Minifies the HTML output of Laravel 5 applications (Originally from https://github.com/fitztrev/laravel-html-minify)

image

yocmen/html-minify

Minifies the HTML output of Laravel 5 applications (Originally from https://github.com/fitztrev/laravel-html-minify)

  • Wednesday, March 1, 2017
  • by yocmen
  • Repository
  • 1 Watchers
  • 16 Stars
  • 11,886 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 5 Versions
  • 3 % Grown

The README.md

Laravel 5 HTML Minify

This package is originally from https://github.com/fitztrev/laravel-html-minify i just updated the package and made it compatible with laravel 5., (*1)

About

This package compresses the HTML output from your Laravel 5 application, seamlessly reducing the overall response size of your pages., (*2)

Other scripts that I've seen will compress the HTML output on-the-fly for each request. Instead, this package extends the Blade compiler to save the compiled template files to disk in their compressed state, reducing the overhead for each request., (*3)

Why?

Even with gzip enabled, there is still an improvement in the response size for HTML content-type documents., (*4)

Test Page w/o Gzip w/ Gzip w/ Gzip + Laravel HTML Minify
#1 8,039 bytes 1,944 bytes 1,836 bytes (5.6% improvement)
#2 377,867 bytes 5,247 bytes 4,314 bytes (17.8% improvement)

Installation

  1. Add "yocmen/html-minify": "2.*" to composer.json.
  2. Run composer update
  3. Add Yocmen\HtmlMinify\HtmlMinifyServiceProvider to the list of providers in config/app.php.
  4. Publish your config with php artisan vendor:publish command
  5. Important: You won't see any changes until you edit your *.blade.php template files. Once Laravel detects a change, it will recompile them, which is when this package will go to work. To force all views to be recompiled, just run this command: find . -name "*.blade.php" -exec touch {} \;

Options

  • enabled - boolean, default true
  • comment_stripping - boolean, default true

If you are using a javascript framework that conflicts with Blade's tags, you can change them., (*5)

  • blade.rawTags - array, default {!! and !!}
  • blade.contentTags - array, default {{ and }}
  • blade.escapedContentTags - array, default {{{ and }}}

Skipping minification

To prevent the minification of a view file, add skipmin somewhere in the view., (*6)

{{-- skipmin --}}
<!-- skipmin -->

The Versions

01/03 2017

dev-Laravel-5.4

dev-Laravel-5.4 https://github.com/yocmen/html-minify

Minifies the HTML output of Laravel 5 applications (Originally from https://github.com/fitztrev/laravel-html-minify)

  Sources   Download

MIT

The Requires

 

by Trevor Fitzgerald
by Yocsel Mendoza

laravel html minifier blade l5 performance minify optimization compress

02/08 2016

dev-master

9999999-dev https://github.com/yocmen/html-minify

Minifies the HTML output of Laravel 5 applications (Originally from https://github.com/fitztrev/laravel-html-minify)

  Sources   Download

MIT

The Requires

 

by Trevor Fitzgerald
by Yocsel Mendoza

laravel html minifier blade l5 performance minify optimization compress

02/08 2016

v2.0.2

2.0.2.0 https://github.com/yocmen/html-minify

Minifies the HTML output of Laravel 5 applications (Originally from https://github.com/fitztrev/laravel-html-minify)

  Sources   Download

MIT

The Requires

 

by Trevor Fitzgerald
by Yocsel Mendoza

laravel html minifier blade l5 performance minify optimization compress

09/06 2015

v2.0.1

2.0.1.0 https://github.com/yocmen/html-minify

Minifies the HTML output of Laravel 5 applications (Originally from https://github.com/fitztrev/laravel-html-minify)

  Sources   Download

MIT

The Requires

 

by Trevor Fitzgerald
by Yocsel Mendoza

laravel html minifier blade l5 performance minify optimization compress

14/04 2015

v2.0

2.0.0.0 https://github.com/yocmen/html-minify

Minifies the HTML output of Laravel 5 applications (Originally from https://github.com/fitztrev/laravel-html-minify)

  Sources   Download

MIT

The Requires

 

by Trevor Fitzgerald
by Yocsel Mendoza

laravel html minifier blade l5 performance minify optimization compress