reisraff / phulp-minifier
Minify your css/js
Installs: 6 593
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: >=5.6
- matthiasmullie/minify: ^1.3
- reisraff/phulp: ~1.7
README
The minifier addon for PHULP
Install
$ composer require reisraff/phulp-minifier
Usage
<?php use Phulp\Minifier\CssMinifier; use Phulp\Minifier\JsMinifier; $phulp->task('css', function ($phulp) { $phulp->src(['src/'], '/css$/') // minify ->pipe(new CssMinifier) // write minified files ->pipe($phulp->dest('dist/')); }); $phulp->task('js', function ($phulp) { $phulp->src(['src/'], '/js$/') // minify ->pipe(new JsMinifier) // write minified files ->pipe($phulp->dest('dist/')); });
Options
Set in the constructor.
Join : When join flag is true all distFiles will be merged in one.
joinName : Name of the joined file.
<?php use Phulp\Minifier\CssMinifier; use Phulp\Minifier\JsMinifier; $cssMinifier = new CssMinifier([ // default: false 'join' => true, // default: styles.min.css 'joinName' => 'myMinifiedCss.css' ]); $jsMinifier = new JsMinifier([ // default: false 'join' => true // default: script.min.js 'joinName' => 'myMinifiedJs.js' ]);