dev-master
9999999-devDean Edwards Packer, usable from Symfony2
MIT
The Requires
1.0.0
1.0.0.0Dean Edwards Packer, usable from Symfony2
MIT
The Requires
Wallogit.com
2017 © Pedro Peláez
Dean Edwards Packer, usable from Symfony2
This bundle allows you to use the PHP port of Dean Edward's Packer to compress JavaScripts, (*1)
Feel free to use this bundle but keep in mind it is still in beta stage and needs a bit of testing. If you see any issues with this bundle, please give feedback using the GitHub issue tracker., (*2)
Install via composer:, (*3)
composer require icedream/javascriptpackerbundle:~1.0@beta
Download the PHP port of Dean Edward's packer. The recommended way is to use the suggestion of this package and install meenie/javascript-packer via composer., (*4)
composer require meenie/javascript-packer:~1.1
Add bundle to the application kernel (app/AppKernel.php):, (*5)
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Icedream\JavaScriptPackerBundle\JavaScriptPackerBundle(),
);
// ...
}
}
Configure the bundle in app/config/config.yml:, (*6)
# Assetic Configuration
assetic:
filters:
jspacker:
resource: %kernel.root_dir%/../vendor/icedream/javascriptpackerbundle/Icedream/JavaScriptPackerBundle/Resources/config/services.xml
# If you did not use the composer method to download the Packer script, uncomment this and point the variable to the full path of class.JavaScriptPacker.php
#packer: %kernel.root_dir%/../vendor/meenie/javascript-packer/class.JavaScriptPacker.php
Now you can use the filter as needed., (*7)
{% javascripts '@AcmeDemoBundle/Resources/public/js/somescript.js' filter='jspacker' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
This bundle is licensed under the MIT license. See LICENSE.txt for more information., (*8)
Dean Edwards Packer, usable from Symfony2
MIT
Dean Edwards Packer, usable from Symfony2
MIT