chewett / php-uglifyjs2
A basic wrapper around uglifyjs for PHP
Requires (Dev)
- components/jquery: ^2.2
- pdepend/pdepend: 2.2.1
- phploc/phploc: 2.1.4
- phpmd/phpmd: 2.3.2
- phpunit/phpunit: 5.2.*
- sebastian/phpcpd: 2.0.2
- squizlabs/php_codesniffer: 2.3.4
- theseer/phpdox: 0.8.1.1
- twbs/bootstrap: ^3.3
This package is not auto-updated.
Last update: 2025-01-18 20:14:04 UTC
README
This library is a wrapper around the nodejs uglifyjs script for PHP.
Usage
$ug = new JSUglify(); $output = $ug->uglify(["somefile.js", "secondfile.js"], "output.js");
Given an array of input files and an output file location it will minimise the javascript. Options can be passed in as a third parameter
$ug = new JSUglify(); $output = $ug->uglify(["somefile.js", "secondfile.js"], "output.js", ['compress' => '']);
Here the compress option is given and passed into the uglifyjs command line string as a flag --compress
Installation
This can be included in your composer project by running
composer require chewett/php-uglifyjs
Then running composer update
will update your composer lock file to include and download this new dependency.
Tests
Tests can be run with the phpunit test runner using the provided phpunit.xml file.
License
This is licensed under the MIT license. For more information see the LICENSE file.