zoerb / filerevbundle
根据JSON配置处理资源重写
v1.1.1
2016-10-28 09:24 UTC
Requires
- php: >=5.3.9
- symfony/framework-bundle: >=2.7
This package is not auto-updated.
Last update: 2024-09-12 00:10:16 UTC
README
此包增加了根据JSON配置处理资源缓存破坏重写的支持。它允许您删除assetic并使用前端工具如grunt或gulp来构建和重写资源。您唯一需要的是由gulp-rev或grunt-filerev提供的rev摘要,并且此包将处理其余所有事情。
摘要文件应类似于以下内容
{
"/styles/main.css": "/styles/main.59983df7.css",
"/scripts/main.js": "/scripts/main.c711a749.js"
}
安装
步骤 1:下载
composer require zoerb/filerevbundle
步骤 2:启用包
最后,在内核中启用包
<?php // app/appKernel.php public function registerBundles() { $bundles = array( // ... new Zoerb\Bundle\FilerevBundle\ZoerbFilerevBundle(), ); }
配置
将以下配置添加到您的app/config/config.yml
zoerb_filerev: ~
选项
summary_file
类型:string 默认值:'%kernel.root_dir%/config/rev-manifest.json'
指向rev摘要文件
enbled
类型:bool 默认值:true
debug
类型:bool 默认值:%kernel.debug%
root_dir
类型:string 默认值:'%kernel.root_dir%/../web'
length
类型:int 默认:8
文件哈希的字符数。
separator
类型:string 默认:.
分隔文件名和哈希的字符。
变更日志
我能贡献吗?
当然可以。我们感谢所有贡献者,并欢迎进一步改进项目的贡献。如果您不确定是否应该添加某些内容,请随时打开一个问题,我们可以讨论它。
许可证
MIT © Ben Zörb