fabiang / assetic-google-closure-compiler
Google Closure Compiler for the PHP assetic library (Java/JAR version)
v1.3.0
2024-01-24 10:11 UTC
Requires
- php: ^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0
- assetic/framework: ^2.0 || ^3.0
Requires (Dev)
- packagelist/closurecompiler-bin: ^2016.02
- phpspec/prophecy: ^1.17
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.6.4
- symfony/process: ^6.0 || ^5.3.7 || ^4.4.30
README
Installation
New to Composer? Read the introduction. Run the following Composer command:
composer require --dev fabiang/assetic-google-closure-compiler
Note: Remove --dev
if you don't compile the assets while building your application before deploying it and you need the filter on production.
Usage in a Laminas application
Add this filter to you assetic configuration (e.g. assetic.global.php
):
<?php return [ 'assetic_configuration' => [ // [...] 'modules' => [ 'MyModule' => [ 'collections' => [ 'my_collection' => [ 'filters' => [ '?JSMinFilter' => [ 'name' => Assetic\Filter\GoogleClosure\CompilerJarFilter::class, 'option' => [ realpath('node_modules/google-closure-compiler/compiler.jar'), ], ], ], ], ], ], ], ], ];
The class CompilerJarFilter
accepts two arguments:
- the path to the composer.jar
- the path to your Java binary (default is
/usr/bin/java
)
Licence
BSD-2-Clause. See the LICENSE.md.