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
- Host: GitHub
- URL: https://github.com/reisraff/phulp-minifier
- Owner: reisraff
- License: mit
- Created: 2016-05-18T01:17:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-27T19:09:35.000Z (over 4 years ago)
- Last Synced: 2025-05-29T19:51:25.904Z (4 months ago)
- Topics: minifier, minifier-addon, php, phulp, phulp-minifier, phulpplugin
- Language: PHP
- Homepage: https://github.com/reisraff/phulp
- Size: 23.4 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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'
]);```