{"action":"opened","number":31,"pull_request":{"url":"https://api.github.com/repos/danvk/source-map-explorer/pulls/31","id":65911476,"html_url":"https://github.com/danvk/source-map-explorer/pull/31","diff_url":"https://github.com/danvk/source-map-explorer/pull/31.diff","patch_url":"https://github.com/danvk/source-map-explorer/pull/31.patch","issue_url":"https://api.github.com/repos/danvk/source-map-explorer/issues/31","number":31,"state":"open","locked":false,"title":"feature(cli): adding --root=PATH to specify common source path","user":{"login":"rodneyrehm","id":186837,"avatar_url":"https://avatars.githubusercontent.com/u/186837?v=3","gravatar_id":"","url":"https://api.github.com/users/rodneyrehm","html_url":"https://github.com/rodneyrehm","followers_url":"https://api.github.com/users/rodneyrehm/followers","following_url":"https://api.github.com/users/rodneyrehm/following{/other_user}","gists_url":"https://api.github.com/users/rodneyrehm/gists{/gist_id}","starred_url":"https://api.github.com/users/rodneyrehm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodneyrehm/subscriptions","organizations_url":"https://api.github.com/users/rodneyrehm/orgs","repos_url":"https://api.github.com/users/rodneyrehm/repos","events_url":"https://api.github.com/users/rodneyrehm/events{/privacy}","received_events_url":"https://api.github.com/users/rodneyrehm/received_events","type":"User","site_admin":false},"body":"In order to combat weird output caused by SourceMaps referencing `node_modules/*` instead of `/path/to/project/node_modules/*` and having to specify `/path/to/project/` in a `--replace` argument, the `--root` option allows to specify the common root.\r\n\r\nI used to do this as follows, without realising, that the `process.cwd()` would not necessarily match:\r\n\r\n```bash\r\nsource-map-explorer dist/bundle.min.js \\\r\n  --replace \"`node -e 'console.log(process.cwd())'`/dist/\" --with '' \\\r\n  --html > reports/bundle-size.html\r\n```\r\n\r\nWith this change I can run the following and not think about directories anymore:\r\n\r\n```bash\r\nsource-map-explorer dist/bundle.min.js --root=dist \\\r\n  --html > reports/bundle-size.html\r\n```","created_at":"2016-04-10T14:09:49Z","updated_at":"2016-04-10T14:09:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/danvk/source-map-explorer/pulls/31/commits","review_comments_url":"https://api.github.com/repos/danvk/source-map-explorer/pulls/31/comments","review_comment_url":"https://api.github.com/repos/danvk/source-map-explorer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/danvk/source-map-explorer/issues/31/comments","statuses_url":"https://api.github.com/repos/danvk/source-map-explorer/statuses/8ed0247c980240603c1c6d516d44044d23142298","head":{"label":"rodneyrehm:feature/root-directory","ref":"feature/root-directory","sha":"8ed0247c980240603c1c6d516d44044d23142298","user":{"login":"rodneyrehm","id":186837,"avatar_url":"https://avatars.githubusercontent.com/u/186837?v=3","gravatar_id":"","url":"https://api.github.com/users/rodneyrehm","html_url":"https://github.com/rodneyrehm","followers_url":"https://api.github.com/users/rodneyrehm/followers","following_url":"https://api.github.com/users/rodneyrehm/following{/other_user}","gists_url":"https://api.github.com/users/rodneyrehm/gists{/gist_id}","starred_url":"https://api.github.com/users/rodneyrehm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodneyrehm/subscriptions","organizations_url":"https://api.github.com/users/rodneyrehm/orgs","repos_url":"https://api.github.com/users/rodneyrehm/repos","events_url":"https://api.github.com/users/rodneyrehm/events{/privacy}","received_events_url":"https://api.github.com/users/rodneyrehm/received_events","type":"User","site_admin":false},"repo":{"id":55901079,"name":"source-map-explorer","full_name":"rodneyrehm/source-map-explorer","owner":{"login":"rodneyrehm","id":186837,"avatar_url":"https://avatars.githubusercontent.com/u/186837?v=3","gravatar_id":"","url":"https://api.github.com/users/rodneyrehm","html_url":"https://github.com/rodneyrehm","followers_url":"https://api.github.com/users/rodneyrehm/followers","following_url":"https://api.github.com/users/rodneyrehm/following{/other_user}","gists_url":"https://api.github.com/users/rodneyrehm/gists{/gist_id}","starred_url":"https://api.github.com/users/rodneyrehm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodneyrehm/subscriptions","organizations_url":"https://api.github.com/users/rodneyrehm/orgs","repos_url":"https://api.github.com/users/rodneyrehm/repos","events_url":"https://api.github.com/users/rodneyrehm/events{/privacy}","received_events_url":"https://api.github.com/users/rodneyrehm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rodneyrehm/source-map-explorer","description":"Analyze and debug space usage through source maps","fork":true,"url":"https://api.github.com/repos/rodneyrehm/source-map-explorer","forks_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/forks","keys_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/teams","hooks_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/hooks","issue_events_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/issues/events{/number}","events_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/events","assignees_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/assignees{/user}","branches_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/branches{/branch}","tags_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/tags","blobs_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/git/refs{/sha}","trees_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/statuses/{sha}","languages_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/languages","stargazers_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/stargazers","contributors_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/contributors","subscribers_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/subscribers","subscription_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/subscription","commits_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/commits{/sha}","git_commits_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/git/commits{/sha}","comments_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/comments{/number}","issue_comment_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/issues/comments{/number}","contents_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/contents/{+path}","compare_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/merges","archive_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/downloads","issues_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/issues{/number}","pulls_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/pulls{/number}","milestones_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/milestones{/number}","notifications_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/labels{/name}","releases_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/releases{/id}","deployments_url":"https://api.github.com/repos/rodneyrehm/source-map-explorer/deployments","created_at":"2016-04-10T13:39:53Z","updated_at":"2016-04-10T13:39:54Z","pushed_at":"2016-04-10T14:04:32Z","git_url":"git://github.com/rodneyrehm/source-map-explorer.git","ssh_url":"git@github.com:rodneyrehm/source-map-explorer.git","clone_url":"https://github.com/rodneyrehm/source-map-explorer.git","svn_url":"https://github.com/rodneyrehm/source-map-explorer","homepage":null,"size":73,"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":"danvk:master","ref":"master","sha":"ab2f0a984801a23ffe49764a4014cb0e0b37a6eb","user":{"login":"danvk","id":98301,"avatar_url":"https://avatars.githubusercontent.com/u/98301?v=3","gravatar_id":"","url":"https://api.github.com/users/danvk","html_url":"https://github.com/danvk","followers_url":"https://api.github.com/users/danvk/followers","following_url":"https://api.github.com/users/danvk/following{/other_user}","gists_url":"https://api.github.com/users/danvk/gists{/gist_id}","starred_url":"https://api.github.com/users/danvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvk/subscriptions","organizations_url":"https://api.github.com/users/danvk/orgs","repos_url":"https://api.github.com/users/danvk/repos","events_url":"https://api.github.com/users/danvk/events{/privacy}","received_events_url":"https://api.github.com/users/danvk/received_events","type":"User","site_admin":false},"repo":{"id":44349554,"name":"source-map-explorer","full_name":"danvk/source-map-explorer","owner":{"login":"danvk","id":98301,"avatar_url":"https://avatars.githubusercontent.com/u/98301?v=3","gravatar_id":"","url":"https://api.github.com/users/danvk","html_url":"https://github.com/danvk","followers_url":"https://api.github.com/users/danvk/followers","following_url":"https://api.github.com/users/danvk/following{/other_user}","gists_url":"https://api.github.com/users/danvk/gists{/gist_id}","starred_url":"https://api.github.com/users/danvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvk/subscriptions","organizations_url":"https://api.github.com/users/danvk/orgs","repos_url":"https://api.github.com/users/danvk/repos","events_url":"https://api.github.com/users/danvk/events{/privacy}","received_events_url":"https://api.github.com/users/danvk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danvk/source-map-explorer","description":"Analyze and debug space usage through source maps","fork":false,"url":"https://api.github.com/repos/danvk/source-map-explorer","forks_url":"https://api.github.com/repos/danvk/source-map-explorer/forks","keys_url":"https://api.github.com/repos/danvk/source-map-explorer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danvk/source-map-explorer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danvk/source-map-explorer/teams","hooks_url":"https://api.github.com/repos/danvk/source-map-explorer/hooks","issue_events_url":"https://api.github.com/repos/danvk/source-map-explorer/issues/events{/number}","events_url":"https://api.github.com/repos/danvk/source-map-explorer/events","assignees_url":"https://api.github.com/repos/danvk/source-map-explorer/assignees{/user}","branches_url":"https://api.github.com/repos/danvk/source-map-explorer/branches{/branch}","tags_url":"https://api.github.com/repos/danvk/source-map-explorer/tags","blobs_url":"https://api.github.com/repos/danvk/source-map-explorer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danvk/source-map-explorer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danvk/source-map-explorer/git/refs{/sha}","trees_url":"https://api.github.com/repos/danvk/source-map-explorer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danvk/source-map-explorer/statuses/{sha}","languages_url":"https://api.github.com/repos/danvk/source-map-explorer/languages","stargazers_url":"https://api.github.com/repos/danvk/source-map-explorer/stargazers","contributors_url":"https://api.github.com/repos/danvk/source-map-explorer/contributors","subscribers_url":"https://api.github.com/repos/danvk/source-map-explorer/subscribers","subscription_url":"https://api.github.com/repos/danvk/source-map-explorer/subscription","commits_url":"https://api.github.com/repos/danvk/source-map-explorer/commits{/sha}","git_commits_url":"https://api.github.com/repos/danvk/source-map-explorer/git/commits{/sha}","comments_url":"https://api.github.com/repos/danvk/source-map-explorer/comments{/number}","issue_comment_url":"https://api.github.com/repos/danvk/source-map-explorer/issues/comments{/number}","contents_url":"https://api.github.com/repos/danvk/source-map-explorer/contents/{+path}","compare_url":"https://api.github.com/repos/danvk/source-map-explorer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danvk/source-map-explorer/merges","archive_url":"https://api.github.com/repos/danvk/source-map-explorer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danvk/source-map-explorer/downloads","issues_url":"https://api.github.com/repos/danvk/source-map-explorer/issues{/number}","pulls_url":"https://api.github.com/repos/danvk/source-map-explorer/pulls{/number}","milestones_url":"https://api.github.com/repos/danvk/source-map-explorer/milestones{/number}","notifications_url":"https://api.github.com/repos/danvk/source-map-explorer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danvk/source-map-explorer/labels{/name}","releases_url":"https://api.github.com/repos/danvk/source-map-explorer/releases{/id}","deployments_url":"https://api.github.com/repos/danvk/source-map-explorer/deployments","created_at":"2015-10-15T22:40:17Z","updated_at":"2016-04-09T05:03:53Z","pushed_at":"2016-04-10T14:09:50Z","git_url":"git://github.com/danvk/source-map-explorer.git","ssh_url":"git@github.com:danvk/source-map-explorer.git","clone_url":"https://github.com/danvk/source-map-explorer.git","svn_url":"https://github.com/danvk/source-map-explorer","homepage":null,"size":71,"stargazers_count":261,"watchers_count":261,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":12,"forks":6,"open_issues":12,"watchers":261,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/danvk/source-map-explorer/pulls/31"},"html":{"href":"https://github.com/danvk/source-map-explorer/pull/31"},"issue":{"href":"https://api.github.com/repos/danvk/source-map-explorer/issues/31"},"comments":{"href":"https://api.github.com/repos/danvk/source-map-explorer/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/danvk/source-map-explorer/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/danvk/source-map-explorer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/danvk/source-map-explorer/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/danvk/source-map-explorer/statuses/8ed0247c980240603c1c6d516d44044d23142298"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":15,"deletions":1,"changed_files":2}}