Twig-Assetic-Fixer try to fix the issue: The debug = true
, combine = false
options not work and asset files always combined when using Twig with Assetic.
Install by Composer
"require": {
"wake/Twig-Assetic-Fixer": "*"
}
Check last section of Assetic#Twig, replace
use Assetic\Extension\Twig\TwigFormulaLoader;
with
use TwigAsseticFixer\TwigFormulaLoader;
如果你正好在使用 Twig + Assetic 並且遇到 debug = true 或 combine = false 時,檔案依然合併為一個的問題,那麼此修正檔或許可以幫助你。
透過 Composer 安裝
"require": {
"wake/Twig-Assetic-Fixer": "*"
}
參考 Assetic#Twig,最下方有提到 These assets need to be written to the web directory so these URLs don't return 404 errors.
,請將原本
use Assetic\Extension\Twig\TwigFormulaLoader;
改換成
use TwigAsseticFixer\TwigFormulaLoader;
有任何疑問或需要協助的歡迎開 issue 😏