An open API service indexing awesome lists of open source software.

https://github.com/reisraff/phulp-minifier

The minifier addon for phulp
https://github.com/reisraff/phulp-minifier

minifier minifier-addon php phulp phulp-minifier phulpplugin

Last synced: 3 months ago
JSON representation

The minifier addon for phulp

Awesome Lists containing this project

README

          

# phulp-minifier

The minifier addon for [PHULP](https://github.com/reisraff/phulp)

## Install

```bash
$ composer require reisraff/phulp-minifier
```

## Usage

```php
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
true,
// default: styles.min.css
'joinName' => 'myMinifiedCss.css'
]);
$jsMinifier = new JsMinifier([
// default: false
'join' => true
// default: script.min.js
'joinName' => 'myMinifiedJs.js'
]);

```