Assetic 没有合并 bootstrap.css 和 bootstrap-responsive.css [英] Assetic isn't merging bootstrap.css and bootstrap-responsive.css

查看:26
本文介绍了Assetic 没有合并 bootstrap.css 和 bootstrap-responsive.css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Symfony2 和 Assetic.

I am using Symfony2 and Assetic.

assetic 在 dev 上运行良好(debug = true),但是当我为 prod 运行转储时它没有合并 bootstrap.css 和 bootstrap-responsive.css(debug = false).

The assetic runs fine on dev (debug = true), however it is not merging the bootstrap.css and bootstrap-responsive.css when I run the dump for prod (debug = false).

有什么想法吗?tkx

推荐答案

为了临时解决问题,我需要将 bootstrap.css 放在 twig ({% stylesheets) 之外,例如:

In order to temporary solve the issue, I needed to put the bootstrap.css outside the twig ({% stylesheets), example:

 /* Instead of: */
{% stylesheets 'bundles/foobar/css/*' %}
<link rel="stylesheet" href="{{ asset_url }}">
{% endstylesheets %}


/* I am doing: */
<link rel="stylesheet" href='/bundles/foobar/css/bootstrap.css'>
{% stylesheets
'bundles/foobar/css/bootstrap-responsive.css'
'bundles/foobar/css/chosen.css'
'bundles/foobar/css/custom.css'
%}
<link rel="stylesheet" href="{{ asset_url }}">
{% endstylesheets %}

这篇关于Assetic 没有合并 bootstrap.css 和 bootstrap-responsive.css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆