我创建了一个名为“staging”的新环境,它与“生产”环境的配置几乎相同,我正在尝试在我的 css 和 js 文件上使用 yui_compressor。请在下面查看我的 css 文件示例:
{% stylesheets output='css/compiled/main.css' filter='?yui_css' filter='cssrewrite'
'bundles/xyz/lib/frontend/css/social_foundicons.css'
'bundles/xyz/lib/frontend/css/general_enclosed_foundicons.css'
'bundles/xyz/lib/frontend/css/general_foundicons.css'
'bundles/xyz/lib/frontend/coda/css/coda-slider.css'
%}
<link rel="stylesheet" type="text/css" media="screen" href="{{ asset_url }}" />
{% endstylesheets %}
<!-- Google fonts -->
{% stylesheets output='css/compiled/fonts.css' filter='?yui_css' filter='cssrewrite'
'bundles/xyz/lib/frontend/css/fonts.css'
%}
<link rel="stylesheet" type="text/css" media="screen" href="{{ asset_url }}" />
{% endstylesheets %}
<!-- Included CSS Files -->
{% stylesheets output='css/compiled/style.css' filter='?yui_css' filter='cssrewrite'
'bundles/xyz/lib/frontend/css/style.css'
%}
<link rel="stylesheet" type="text/css" media="screen" href="{{ asset_url }}" />
{% endstylesheets %}
使用 capistrano 部署时,会创建以下文件:
- /web/css/compiled/fonts.css
- /web/css/compiled/main.css
- /web/css/compiled/style.css
我认为这是正确的,但是我的应用程序中的标题呈现以下内容:
<link rel="stylesheet" type="text/css" media="screen" href="/css/compiled/main_social_foundicons_1.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/compiled/main_general_enclosed_foundicons_2.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/compiled/main_general_foundicons_3.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/compiled/main_coda-slider_4.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/compiled/fonts_fonts_1.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/compiled/style_style_1.css" />
服务器上不存在上述文件,我认为它应该调用 /css/compiled/fonts.css、main.css 和 style.css。
有谁知道它为什么这样做?
谢谢