将uglifycss应用于我的css时,我所有的@media和@font-face声明都会丢失
我在我的基本细枝模板中使用以下块来创建压缩的css文件:将uglifycss应用于我的css时,我所有的@media和@font-face声明都会丢失,css,uglifycss,Css,Uglifycss,我在我的基本细枝模板中使用以下块来创建压缩的css文件: {% stylesheets output='bundles/myBundle/compressed/compressed.css' filter='uglifycss' filter='cssrewrite' 'bundles/myBundle/stylesheets/app.css' 'bundles/my
{% stylesheets output='bundles/myBundle/compressed/compressed.css'
filter='uglifycss'
filter='cssrewrite'
'bundles/myBundle/stylesheets/app.css'
'bundles/myBundle/stylesheets/tablet.css'
'bundles/myBundle/stylesheets/phone.css'
%}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
在bash命令行上执行相同的命令也会导致相同的错误行为。所以这不是一个符号或资产问题,而是一个丑陋的问题
有什么想法吗
干杯,
Dominik进一步调试发现,css注释是问题所在 根据这样的评论:
/*/////////////////////////////////*/
/* some comment */
/*/////////////////////////////////*/
但事实证明,uglifycss 0.0.15对于以“/*/”结尾的注释存在问题
在最后一个“/”和“*/”之间添加一个空格解决了我的问题
/*//////////////////////////////// */
/* some comment */
/*//////////////////////////////// */
我还打开了github上的一个问题
干杯,
多米尼克
/*//////////////////////////////// */
/* some comment */
/*//////////////////////////////// */