nckg/laravel-minify-html
最新稳定版本:1.4.0
Composer 安装命令:
composer require nckg/laravel-minify-html
包简介
Minify your responses in Laravel 5.x
README 文档
README
Introduction
Very, very simple html minifier with Laravel 5.x support.
It minifies HTML by
- removing HTML comments except IE conditions
- removing comments
- shorten multiple white spaces
- removing whitespaces between HTML tags
- collapsing new lines
You should end up with a small size profit:
| Uniminfied | Minified |
|---|---|
| 64.2KB | 44.6KB |
Code Samples
$input = "<a href="/foo" class="bar moo ">Hello World</a>"; $minifier = new Minifier(); $output = $minifier->html($string); // <a href="/foo" class="bar moo ">Hello World</a>
Installation
You can install the package via composer:
composer require nckg/laravel-minify-html
If you are using Laravel you can add the middleware to your middleware providers
// app/Http/Kernel.php /** * The application's global HTTP middleware stack. * * @var array */ protected $middleware = [ ... \Nckg\Minify\Middleware\MinifyResponse::class, ];
Testing
composer test
License
The MIT License (MIT).
统计信息
- 总下载量: 38.44k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-26