0
我正在使用bower管理許多常見資產並遇到問題。我試圖使用Slick.js來旋轉輪播,我通過Assetic運行它來合併和縮小資產。使用CSSREWRITE在Symfony3中進行資產管理
這裏是我的樣式表中的樹枝:
{% stylesheets
"vendor/jquery-ui/themes/base/jquery-ui.min.css"
"vendor/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.min.css"
"vendor/datatables.net-dt/css/jquery.dataTables.min.css"
"vendor/datatables.net-responsive-dt/css/responsive.dataTables.min.css"
"vendor/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.min.css"
"vendor/slick-carousel/slick/slick.css"
"vendor/slick-carousel/slick/slick-theme.css"
"css/*.css"
"scss/*.scss"
"@SHUDirectoryBundle/Resources/public/css/*.scss"
filter="cssrewrite,scssphp,?uglifycss"
output="css/combined/myshu.min.css"
%}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
這裏是我的Assetic配置:
assetic:
debug: '%kernel.debug%'
use_controller: '%kernel.debug%'
node: /usr/bin/nodejs
filters:
cssrewrite: ~
uglifyjs2:
bin: /usr/local/bin/uglifyjs
uglifycss:
bin: /usr/local/bin/uglifycss
scssphp:
formatter: 'Leafo\ScssPhp\Formatter\Compressed'
在油滑theme.css文件它引用了以下內容:
@font-face
{
font-family: 'slick';
font-weight: normal;
font-style: normal;
src: url('./fonts/slick.eot');
src: url('./fonts/slick.eot?#iefix') format('embedded-opentype'), url('./fonts/slick.woff') format('woff'), url('./fonts/slick.ttf') format('truetype'), url('./fonts/slick.svg#slick') format('svg');
}
我假設CSSREWRITE會採用相對路徑./並將其寫入直接路徑vendor/sli例如,ck-carousel/slick/fonts/slick.woff。