Closed ghost closed 9 years ago
What's the CSS that is generated after running through Munee? Can you please post it?
@polaris-zx: Please reopen this issue if you're still having issues.
I also have an issue with @font-face
@font-face {
font-family: 'cholaslab';
src: url("/assets/fonts/chollaslabotce-regular.woff"),
url("/assets/fonts/chollaslabotce-regular.eot"),
url("/assets/fonts/chollaslabotce-regular.ttf") format("truetype"),
url("/assets/fonts/chollaslaslabotce-regular.svg") format("svg");
}
compiles to: @font-face{font-family:"cholaslab";src:url("/index.php?files=/assets/fonts/chollaslabotce-regular.woff"),url("/index.php?files=/assets/fonts/chollaslabotce-regular.eot"),url("/index.php?files=/assets/fonts/chollaslabotce-regular.ttf") format("truetype"),url("/index.php?files=/assets/fonts/chollaslaslabotce-regular.svg") format("svg");
I'm using codeigniter(mvc), so any request goes through index.php and I don't use htaccess using munee, so my link href looks like: "munee?files=/assets/css/style.css&minify=true"
Anyway, great job!
So you are using codeigniter to run the request through Munee? Meaning you are using it's Dispatcher? You are using the API directly?
Also, it shouldn't be rewriting any of your font URL's because they are already absolute (starting with a /
). You can see that I have a rule for that here: https://github.com/meenie/munee/blob/master/src/Munee/Asset/Type/Css.php#L222
Actually, I see now where this might an issue and I see a fix for it :). I'm guessing the code path is going into here: https://github.com/meenie/munee/blob/master/src/Munee/Asset/Type/Css.php#L248. You should set the MUNEE_DISPATCHER_FILE
constant to munee
and this should fix it for you.
The thing is, it shouldn't be running font files through Munee in the first place because it won't know what to do with them. The usual rule for the .htaccess
is to specify which files it should run through Munee: css|less|scss|js|coffee|jpg|png|gif|jpeg
. It looks like this is a bug. It should fix the URL's if they aren't absolute, but if you are not using the URL Rewrite functionality, it should only run supported files through Munee. I'll create a ticket for that.
Im using Dipatcher inside my controller, not API. And it's working, things minify and concat.
<?php
class Munee extends CI_Controller
{
function __construct()
{
parent::__construct();
require APPPATH.'vendor/autoload.php';
echo \Munee\Dispatcher::run(new \Munee\Request());
}
function index() //it has to be
{ }
}
I wanted to use Munee without htaccess to have more control, when I want to use it, so I went with no htaccess.
Changing MUNEE_DISPATCHER_FILE
to munee
also doesnt work for me, now things change to url("munee?files=/assets/fonts/chollaslabotce-regular.eot"),
Sending font files through munee dispatcher returns error Error: The following extension is not handled: woff
, so maybe try to filter types of files inside url to ignore font extensions ?
Sending font files through munee dispatcher returns error Error: The following extension is not handled: woff , so maybe try to filter types of files inside url to ignore font extensions ?
Yup, which is why I created #88 :). Thanks for reporting this bug! Oversite on my part.
i can not load the font.