{"action":"created","issue":{"url":"https://api.github.com/repos/matthiasmullie/minify/issues/38","labels_url":"https://api.github.com/repos/matthiasmullie/minify/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/matthiasmullie/minify/issues/38/comments","events_url":"https://api.github.com/repos/matthiasmullie/minify/issues/38/events","html_url":"https://github.com/matthiasmullie/minify/issues/38","id":58100862,"number":38,"title":"@import not treated right","user":{"login":"webbird","id":147354,"avatar_url":"https://avatars.githubusercontent.com/u/147354?v=3","gravatar_id":"","url":"https://api.github.com/users/webbird","html_url":"https://github.com/webbird","followers_url":"https://api.github.com/users/webbird/followers","following_url":"https://api.github.com/users/webbird/following{/other_user}","gists_url":"https://api.github.com/users/webbird/gists{/gist_id}","starred_url":"https://api.github.com/users/webbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webbird/subscriptions","organizations_url":"https://api.github.com/users/webbird/orgs","repos_url":"https://api.github.com/users/webbird/repos","events_url":"https://api.github.com/users/webbird/events{/privacy}","received_events_url":"https://api.github.com/users/webbird/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-02-18T17:38:46Z","updated_at":"2015-02-25T11:26:24Z","closed_at":"2015-02-20T15:53:05Z","body":"I am trying to minify a bunch of CSS files like so:\r\n\r\n    if(count($files))\r\n        foreach(array_values($files) as $file)\r\n            $minifier->add($file);\r\n\r\n...where `$files` is an array of local file names (=paths, not URIs).\r\n\r\nThe first file contains a list of `@import`s, which are resolved the wrong way. Result is:\r\n\r\n    @import url(../P:/apache/htdocs/...more.../reset.css);\r\n\r\nI would expect either an URL or that the imported file is read an minified too. Of course, returning an URL is not that easy, as the class would have to guess the URL from the path. (Or allow to set a BaseURL as a config param.) Anyway, better way would be to replace the imports with the minified contents of the files. Could be done quite easily by checking for local files with `file_exists()`.\r\n\r\nI have a workaround I got from another class (https://github.com/dg/ftp-deployment/blob/v1.1/Deployment/libs/Preprocessor.php#L63), but you may like to have a look at this. Maybe I am doing something wrong?"},"comment":{"url":"https://api.github.com/repos/matthiasmullie/minify/issues/comments/75944967","html_url":"https://github.com/matthiasmullie/minify/issues/38#issuecomment-75944967","issue_url":"https://api.github.com/repos/matthiasmullie/minify/issues/38","id":75944967,"user":{"login":"webbird","id":147354,"avatar_url":"https://avatars.githubusercontent.com/u/147354?v=3","gravatar_id":"","url":"https://api.github.com/users/webbird","html_url":"https://github.com/webbird","followers_url":"https://api.github.com/users/webbird/followers","following_url":"https://api.github.com/users/webbird/following{/other_user}","gists_url":"https://api.github.com/users/webbird/gists{/gist_id}","starred_url":"https://api.github.com/users/webbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webbird/subscriptions","organizations_url":"https://api.github.com/users/webbird/orgs","repos_url":"https://api.github.com/users/webbird/repos","events_url":"https://api.github.com/users/webbird/events{/privacy}","received_events_url":"https://api.github.com/users/webbird/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T11:26:24Z","updated_at":"2015-02-25T11:26:24Z","body":"Not really to be honest. :D It may be a consequence of doing performance tests while searching for a 'perfect' solution. Also, in some environments it may not be allowed to write into the source folder. (By file system permissions.) But I think in this case the on-the-fly-minification would just eat up the positive effects of minified files. So it seems to be just a matter of not thinking it out."}}