middlewares/minifier

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

middlewares/minifier

Latest Version on Packagist Software License Build Status Quality Score Total Downloads SensioLabs Insight

Middleware to minify the Html, CSS and Javascript content using mrclay/minify. This package is splited into the following components:

Requirements
Installation

This package is installable and autoloadable via Composer as middlewares/minifier.

oser require middlewares/minifier
Example
patcher = new Dispatcher([
new Middlewares\CssMinifier(),
new Middlewares\JsMinifier(),
new Middlewares\HtmlMinifier(),


ponse = $dispatcher->dispatch(new ServerRequest());
HtmlMinifier

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)

CssMinifier

Minifies the code of css responses. Make sure the response contains the header Content-Type: text/css.

JsMinifier

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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.