-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No support for Absolute paths on Assets #6
Comments
I can't reproduce this. Can you share more details?
|
Hi @moltam , I have provided all responses below as well as additional relevant config to clarify; //----Path of CSS file //----Path of FontAwesome files //----Declaration of FontAwesome in font-awesome.css (Standard for FontAwesome 4.3.0) //----Relevant setting in /config/bootstrap.php //----Listing of relevant Asset bundle - FrontendAsset.php \yii\web\View::POS_HEAD, ]; ``` public $css = [ 'css/font-awesome.css', 'css/line-icons.min.css', 'css/animations.min.css', 'css/bootstrap.min.css', 'css/google-fonts.min.css', 'css/bootstrap-theme.min.css', 'css/style.min.css', 'css/colors/color6.min.css', 'css/custom.css', ]; public $js = [ 'js/plugins.js', 'js/modernizr.js', ]; public $images = [ ]; public $depends = [ 'yii\web\YiiAsset', 'yii\web\JqueryAsset', 'common\assets\Html5shiv', ]; ``` } **//----Extract from Homepage - View source** ... ![image](https://cloud.githubusercontent.com/assets/9496750/15685055/ee93fbf2-2761-11e6-85bf-1e93ca86b269.png) **//----Extract from Combined CSS files** **\* BEGIN FILE: font-awesome.min.css ***/ @font-face{font-family:'FontAwesome';src:url('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.eot?v=4.3.0');src:url('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.eot?#iefix&v=4.3.0') format('embedded-opentype'),url('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.woff2?v=4.3.0') format('woff2'),url('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.woff?v=4.3.0') format('woff'),url('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.ttf?v=4.3.0') format('truetype'),url('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular') **//----Asset Minifier Config** ... 'assetMinifier' => [ 'class' => \lajax\assetminifier\Component::className(), 'minifyJs' => true, // minify js files. [default] 'minifyCss' => true, // minify css files [default] 'combine' => false, // combine asset files. [default] 'createGz' => false, // create compressed .gz file, (so the web server doesn’t need to // compress asset files on each page view). Requires // special web server configuration. [default] 'minifier' => [ // Settings of the components performing the minification of asset files 'workPath' => lajax\assetminifier\Minifier::WORKPATH_SOURCE, // default setting 'js' => [ // Default JS minifier. 'class' => 'lajax\assetminifier\minifiers\PhpJsMinifier', // default settings, you can override them 'options' => [ 'flaggedComments' => true // Disable YUI style comment preservation. ] ], 'css' => [ // Default CSS minifier. 'class' => 'lajax\assetminifier\minifiers\PhpCssMinifier', // default settings, you can override them 'filters' => [ 'ImportImports' => false, 'RemoveComments' => true, 'RemoveEmptyRulesets' => true, 'RemoveEmptyAtBlocks' => true, 'ConvertLevel3AtKeyframes' => false, 'ConvertLevel3Properties' => false, 'Variables' => true, 'RemoveLastDelarationSemiColon' => true ], 'plugins' => [ 'Variables' => true, 'ConvertFontWeight' => true, 'ConvertHslColors' => true, 'ConvertRgbColors' => true, 'ConvertNamedColors' => true, 'CompressColorValues' => true, 'CompressExpressionValues' => true, ] ] ], 'combiner' => [ 'class' => 'lajax\assetminifier\Combiner', 'combinedFilesPath' => '/lajax-asset-minifier' ] ], ... |
Thank you for your reply. I've managed to reproduce this. This is caused by the absolute url in the You can use with relative url-s for now. The default |
Hi @moltam , Thanks for your support - and if there is anything I can do to help, just let me know Regards, Adam |
Hi,
It appears that the extension assumes that all URLs are relative when combining the minified assets so references to all resources with absolute paths become unreachable after '../../' is appended to them with the result that all such assets are no longer reachable (Icon files, Images - everything with absolute URL etc). See the following extract from the combined resource files showing the effect on font awesome;
@font-face{font-family:'FontAwesome';src:url**('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.eot?v=4.3.0')**;src:url**('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.eot?#iefix&v=4.3.0')** format('embedded-opentype'),url**('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.woff2?v=4.3.0')** format('woff2'),url**('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.woff?v=4.3.0')** format('woff'),url**('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.ttf?v=4.3.0')** format('truetype'),url**('../../http://advanced.rev/assets/css/fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular')**
Thanks
The text was updated successfully, but these errors were encountered: