This bundle adds support for handling asset cachbusting rewrites based on a JSON configuration.
It enables you to drop assetic and use frontend tooling like grunt
or gulp
to build and rev your assets.
The only thing you need is the rev summary provided by gulp-rev
or grunt-filerev
and this bundle will handle everything else.
The summary file should look something like this:
{
"/styles/main.css": "/styles/main.59983df7.css",
"/scripts/main.js": "/scripts/main.c711a749.js"
}
composer require zoerb/filerevbundle
Finally, enable the bundle in the kernel:
<?php
// app/appKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Zoerb\Bundle\ZoerbFilerevBundle(),
);
}
Add the following configuration to your app/config/config.yml
:
zoerb_filerev: ~
Type: string
Default value: '%kernel.root_dir%/config/filerev.json'
Points to the rev summary file
Type: bool
Default value: true
Type: bool
Default value: %kernel.debug%
Type: string
Default Value: '%kernel.root_dir%/../web'
Type: int
Default: 8
The number of characters of the file hash.
See Changelog.md
Of course. We appreciate all of our contributors and welcome contributions to improve the project further. If you're uncertain whether an addition should be made, feel free to open up an issue and we can discuss it.
MIT © Ben Zörb