{"action":"created","issue":{"url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/481","labels_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/481/labels{/name}","comments_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/481/comments","events_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/481/events","html_url":"https://github.com/jakubpawlowicz/clean-css/issues/481","id":59892825,"number":481,"title":"'root' option causing output file to be blank (0 bytes)","user":{"login":"andrewboni","id":255026,"avatar_url":"https://avatars.githubusercontent.com/u/255026?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewboni","html_url":"https://github.com/andrewboni","followers_url":"https://api.github.com/users/andrewboni/followers","following_url":"https://api.github.com/users/andrewboni/following{/other_user}","gists_url":"https://api.github.com/users/andrewboni/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewboni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewboni/subscriptions","organizations_url":"https://api.github.com/users/andrewboni/orgs","repos_url":"https://api.github.com/users/andrewboni/repos","events_url":"https://api.github.com/users/andrewboni/events{/privacy}","received_events_url":"https://api.github.com/users/andrewboni/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-05T01:52:35Z","updated_at":"2015-03-12T21:00:10Z","closed_at":"2015-03-12T21:00:10Z","body":"Running `clean-css` v3.1.4 via Grunt with the `root` option enabled, causes the output file to be empty\r\n```coffeescript\r\n    cssmin:  \r\n      vendor:\r\n        options:\r\n          root: './public'\r\n          target: './public'\r\n          advanced: false\r\n        files:\r\n          'assets/dist/vendor.min.css': [\r\n            \"#{libPath}/bootstrap/dist/css/bootstrap.min.css\"\r\n        ]\r\n```\r\n```bash\r\nRunning \"cssmin:vendor\" (cssmin) task\r\nVerifying property cssmin.vendor exists in config...OK\r\nFiles: public/lib/bootstrap/dist/css/bootstrap.min.css -> assets/dist/vendor.min.css\r\nOptions: rebase=false, report=\"min\", sourceMap=false, keepSpecialComments=0, root=\"./public\", target=\"./public\"\r\nReading public/lib/bootstrap/dist/css/bootstrap.min.css...OK\r\nWriting assets/dist/vendor.min.css...OK\r\nFile assets/dist/vendor.min.css created 109.52 kB → 0 B\r\n\r\nDone, without errors.\r\n```\r\n\r\nRemoving the `root` option allows the file to be generated as expected (but without the functionality that `root` is supposed to provide, of course).\r\n\r\nAny thoughts on this?"},"comment":{"url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/comments/78615074","html_url":"https://github.com/jakubpawlowicz/clean-css/issues/481#issuecomment-78615074","issue_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/481","id":78615074,"user":{"login":"jakubpawlowicz","id":24273,"avatar_url":"https://avatars.githubusercontent.com/u/24273?v=3","gravatar_id":"","url":"https://api.github.com/users/jakubpawlowicz","html_url":"https://github.com/jakubpawlowicz","followers_url":"https://api.github.com/users/jakubpawlowicz/followers","following_url":"https://api.github.com/users/jakubpawlowicz/following{/other_user}","gists_url":"https://api.github.com/users/jakubpawlowicz/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubpawlowicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubpawlowicz/subscriptions","organizations_url":"https://api.github.com/users/jakubpawlowicz/orgs","repos_url":"https://api.github.com/users/jakubpawlowicz/repos","events_url":"https://api.github.com/users/jakubpawlowicz/events{/privacy}","received_events_url":"https://api.github.com/users/jakubpawlowicz/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T21:00:09Z","updated_at":"2015-03-12T21:00:09Z","body":"@andrewboni I may know what's going on with this setup:\r\n\r\n1. adding `root` option sets a root path all passed files should be relative to\r\n2. \"#{libPath}/bootstrap/dist/css/bootstrap.min.css\" resolves to `public/lib/bootstrap/dist/css/bootstrap.min.css` - see the output above\r\n3. If you set `root: './public'` clean-css will try to resolve the path above as `public/public/lib/bootstrap/dist/css/bootstrap.min.css`, so if it stays empty it will be internally resolved to the current path, i.e. `.`.\r\n\r\nSome side notes:\r\n\r\n1. If you take a look at https://github.com/gruntjs/grunt-contrib-cssmin/blob/master/tasks/cssmin.js#L33 you'll see clean-css errors are not propagated up to grunt, only exceptions;\r\n2. Actually grunt plugin reads the files but just because it reports file size changes, see https://github.com/gruntjs/grunt-contrib-cssmin/blob/master/tasks/cssmin.js#L42, and it does it _after_ minification takes place.\r\n\r\nI will open couple issues in their repo and I'm closing this issue for the time being."}}