Name: minifier
Owner: Middlewares
Description: Middleware to minify Html, CSS and Javascript responses
Created: 2016-10-10 15:42:44.0
Updated: 2018-02-04 18:50:45.0
Pushed: 2018-03-03 21:01:53.0
Homepage: null
Size: 29
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Middleware to minify the Html
, CSS
and Javascript
content using mrclay/minify. This package is splited into the following components:
This package is installable and autoloadable via Composer as middlewares/minifier.
oser require middlewares/minifier
patcher = new Dispatcher([
new Middlewares\CssMinifier(),
new Middlewares\JsMinifier(),
new Middlewares\HtmlMinifier(),
ponse = $dispatcher->dispatch(new ServerRequest());
Minifies the code of html responses. Make sure the response contains the header Content-Type: text/html
(you can use middlewares/negotiation).
inlineCss($inlineCss = true)
Set false
to do not minify inline css. (true
by default)
inlineJs($inlineJs = true)
Set false
to do not minify inline js. (true
by default)
Minifies the code of css responses. Make sure the response contains the header Content-Type: text/css
.
Minifies the code of javascript responses. Make sure the response contains the header Content-Type: text/javascript
.
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.