{"action":"created","comment":{"url":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/comments/32381526","id":32381526,"diff_hunk":"@@ -63,15 +66,26 @@ function fromSource(self, data, whenDone, context) {\n       context.files.pop();\n     } else if (nextAt == mapMatch.index) {\n       var isRemote = /^https?:\\/\\//.test(sourceMapFile) || /^\\/\\//.test(sourceMapFile);\n+      var isDataUri = DATA_URI.test(sourceMapFile);\n       if (isRemote) {\n         return fetchMapFile(self, sourceMapFile, context, proceedToNext);\n       } else {\n         var sourceFile = context.files[context.files.length - 1];\n-        var sourceDir = sourceFile ? path.dirname(sourceFile) : self.options.relativeTo;\n-        var sourceMapPath = path.resolve(self.options.root, path.join(sourceDir || '', sourceMapFile));\n-\n-        var sourceMapData = fs.readFileSync(sourceMapPath, 'utf-8');\n-        self.trackLoaded(sourceFile || undefined, sourceMapPath, sourceMapData);\n+        var sourceMapPath, sourceMapData;\n+        if(isDataUri) {\n+          // source map's path is the same as the source file it comes from\n+          sourceMapPath = path.resolve(self.options.root, sourceFile);\n+          var buffer = dataUriToBuffer(sourceMapFile);","path":"lib/utils/input-source-map-tracker.js","position":33,"original_position":33,"commit_id":"1e0c1f7398e7a9da1165ac500cdc394c238c74dd","original_commit_id":"1e0c1f7398e7a9da1165ac500cdc394c238c74dd","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},"body":"I'm pretty sure we can do without those 2 dependencies given what they do: https://github.com/TooTallNate/node-data-uri-to-buffer/blob/master/index.js#L44","created_at":"2015-06-14T16:37:19Z","updated_at":"2015-06-14T16:37:19Z","html_url":"https://github.com/jakubpawlowicz/clean-css/pull/600#discussion_r32381526","pull_request_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/600","_links":{"self":{"href":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/comments/32381526"},"html":{"href":"https://github.com/jakubpawlowicz/clean-css/pull/600#discussion_r32381526"},"pull_request":{"href":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/600"}}},"pull_request":{"url":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/600","id":37598508,"html_url":"https://github.com/jakubpawlowicz/clean-css/pull/600","diff_url":"https://github.com/jakubpawlowicz/clean-css/pull/600.diff","patch_url":"https://github.com/jakubpawlowicz/clean-css/pull/600.patch","issue_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/600","number":600,"state":"open","locked":false,"title":"Support ingestion of inline, data-uri sourcemaps in input .css","user":{"login":"cspotcode","id":376504,"avatar_url":"https://avatars.githubusercontent.com/u/376504?v=3","gravatar_id":"","url":"https://api.github.com/users/cspotcode","html_url":"https://github.com/cspotcode","followers_url":"https://api.github.com/users/cspotcode/followers","following_url":"https://api.github.com/users/cspotcode/following{/other_user}","gists_url":"https://api.github.com/users/cspotcode/gists{/gist_id}","starred_url":"https://api.github.com/users/cspotcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cspotcode/subscriptions","organizations_url":"https://api.github.com/users/cspotcode/orgs","repos_url":"https://api.github.com/users/cspotcode/repos","events_url":"https://api.github.com/users/cspotcode/events{/privacy}","received_events_url":"https://api.github.com/users/cspotcode/received_events","type":"User","site_admin":false},"body":"This patch enables clean-css to ingest sourcemaps within input .css files where the sourcemap is an inline data URI.","created_at":"2015-06-12T19:55:32Z","updated_at":"2015-06-14T16:37:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/600/commits","review_comments_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/600/comments","review_comment_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/600/comments","statuses_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/statuses/1e0c1f7398e7a9da1165ac500cdc394c238c74dd","head":{"label":"cspotcode:feature/source-map-data-uri","ref":"feature/source-map-data-uri","sha":"1e0c1f7398e7a9da1165ac500cdc394c238c74dd","user":{"login":"cspotcode","id":376504,"avatar_url":"https://avatars.githubusercontent.com/u/376504?v=3","gravatar_id":"","url":"https://api.github.com/users/cspotcode","html_url":"https://github.com/cspotcode","followers_url":"https://api.github.com/users/cspotcode/followers","following_url":"https://api.github.com/users/cspotcode/following{/other_user}","gists_url":"https://api.github.com/users/cspotcode/gists{/gist_id}","starred_url":"https://api.github.com/users/cspotcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cspotcode/subscriptions","organizations_url":"https://api.github.com/users/cspotcode/orgs","repos_url":"https://api.github.com/users/cspotcode/repos","events_url":"https://api.github.com/users/cspotcode/events{/privacy}","received_events_url":"https://api.github.com/users/cspotcode/received_events","type":"User","site_admin":false},"repo":{"id":37331370,"name":"clean-css","full_name":"cspotcode/clean-css","owner":{"login":"cspotcode","id":376504,"avatar_url":"https://avatars.githubusercontent.com/u/376504?v=3","gravatar_id":"","url":"https://api.github.com/users/cspotcode","html_url":"https://github.com/cspotcode","followers_url":"https://api.github.com/users/cspotcode/followers","following_url":"https://api.github.com/users/cspotcode/following{/other_user}","gists_url":"https://api.github.com/users/cspotcode/gists{/gist_id}","starred_url":"https://api.github.com/users/cspotcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cspotcode/subscriptions","organizations_url":"https://api.github.com/users/cspotcode/orgs","repos_url":"https://api.github.com/users/cspotcode/repos","events_url":"https://api.github.com/users/cspotcode/events{/privacy}","received_events_url":"https://api.github.com/users/cspotcode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cspotcode/clean-css","description":"A fast, efficient, and well tested CSS minifier for node.js.","fork":true,"url":"https://api.github.com/repos/cspotcode/clean-css","forks_url":"https://api.github.com/repos/cspotcode/clean-css/forks","keys_url":"https://api.github.com/repos/cspotcode/clean-css/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cspotcode/clean-css/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cspotcode/clean-css/teams","hooks_url":"https://api.github.com/repos/cspotcode/clean-css/hooks","issue_events_url":"https://api.github.com/repos/cspotcode/clean-css/issues/events{/number}","events_url":"https://api.github.com/repos/cspotcode/clean-css/events","assignees_url":"https://api.github.com/repos/cspotcode/clean-css/assignees{/user}","branches_url":"https://api.github.com/repos/cspotcode/clean-css/branches{/branch}","tags_url":"https://api.github.com/repos/cspotcode/clean-css/tags","blobs_url":"https://api.github.com/repos/cspotcode/clean-css/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cspotcode/clean-css/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cspotcode/clean-css/git/refs{/sha}","trees_url":"https://api.github.com/repos/cspotcode/clean-css/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cspotcode/clean-css/statuses/{sha}","languages_url":"https://api.github.com/repos/cspotcode/clean-css/languages","stargazers_url":"https://api.github.com/repos/cspotcode/clean-css/stargazers","contributors_url":"https://api.github.com/repos/cspotcode/clean-css/contributors","subscribers_url":"https://api.github.com/repos/cspotcode/clean-css/subscribers","subscription_url":"https://api.github.com/repos/cspotcode/clean-css/subscription","commits_url":"https://api.github.com/repos/cspotcode/clean-css/commits{/sha}","git_commits_url":"https://api.github.com/repos/cspotcode/clean-css/git/commits{/sha}","comments_url":"https://api.github.com/repos/cspotcode/clean-css/comments{/number}","issue_comment_url":"https://api.github.com/repos/cspotcode/clean-css/issues/comments{/number}","contents_url":"https://api.github.com/repos/cspotcode/clean-css/contents/{+path}","compare_url":"https://api.github.com/repos/cspotcode/clean-css/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cspotcode/clean-css/merges","archive_url":"https://api.github.com/repos/cspotcode/clean-css/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cspotcode/clean-css/downloads","issues_url":"https://api.github.com/repos/cspotcode/clean-css/issues{/number}","pulls_url":"https://api.github.com/repos/cspotcode/clean-css/pulls{/number}","milestones_url":"https://api.github.com/repos/cspotcode/clean-css/milestones{/number}","notifications_url":"https://api.github.com/repos/cspotcode/clean-css/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cspotcode/clean-css/labels{/name}","releases_url":"https://api.github.com/repos/cspotcode/clean-css/releases{/id}","created_at":"2015-06-12T16:03:49Z","updated_at":"2015-06-12T16:03:50Z","pushed_at":"2015-06-12T19:49:57Z","git_url":"git://github.com/cspotcode/clean-css.git","ssh_url":"git@github.com:cspotcode/clean-css.git","clone_url":"https://github.com/cspotcode/clean-css.git","svn_url":"https://github.com/cspotcode/clean-css","homepage":"","size":2769,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jakubpawlowicz:master","ref":"master","sha":"b8f2fec0262a889d39b9ef3d984aae59718525fb","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},"repo":{"id":1419138,"name":"clean-css","full_name":"jakubpawlowicz/clean-css","owner":{"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},"private":false,"html_url":"https://github.com/jakubpawlowicz/clean-css","description":"A fast, efficient, and well tested CSS minifier for node.js.","fork":false,"url":"https://api.github.com/repos/jakubpawlowicz/clean-css","forks_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/forks","keys_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/teams","hooks_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/hooks","issue_events_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/events{/number}","events_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/events","assignees_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/assignees{/user}","branches_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/branches{/branch}","tags_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/tags","blobs_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/git/refs{/sha}","trees_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/statuses/{sha}","languages_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/languages","stargazers_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/stargazers","contributors_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/contributors","subscribers_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/subscribers","subscription_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/subscription","commits_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/commits{/sha}","git_commits_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/git/commits{/sha}","comments_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/comments{/number}","issue_comment_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/comments{/number}","contents_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/contents/{+path}","compare_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/merges","archive_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/downloads","issues_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues{/number}","pulls_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls{/number}","milestones_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/milestones{/number}","notifications_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/labels{/name}","releases_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/releases{/id}","created_at":"2011-02-27T21:05:18Z","updated_at":"2015-06-13T15:30:28Z","pushed_at":"2015-06-14T15:06:16Z","git_url":"git://github.com/jakubpawlowicz/clean-css.git","ssh_url":"git@github.com:jakubpawlowicz/clean-css.git","clone_url":"https://github.com/jakubpawlowicz/clean-css.git","svn_url":"https://github.com/jakubpawlowicz/clean-css","homepage":"","size":5936,"stargazers_count":1326,"watchers_count":1326,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":125,"mirror_url":null,"open_issues_count":36,"forks":125,"open_issues":36,"watchers":1326,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/600"},"html":{"href":"https://github.com/jakubpawlowicz/clean-css/pull/600"},"issue":{"href":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/600"},"comments":{"href":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/600/comments"},"review_comments":{"href":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/600/comments"},"review_comment":{"href":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jakubpawlowicz/clean-css/pulls/600/commits"},"statuses":{"href":"https://api.github.com/repos/jakubpawlowicz/clean-css/statuses/1e0c1f7398e7a9da1165ac500cdc394c238c74dd"}}}}