{"action":"opened","number":1173,"pull_request":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/1173","id":75294817,"html_url":"https://github.com/mishoo/UglifyJS2/pull/1173","diff_url":"https://github.com/mishoo/UglifyJS2/pull/1173.diff","patch_url":"https://github.com/mishoo/UglifyJS2/pull/1173.patch","issue_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1173","number":1173,"state":"open","locked":false,"title":"Allow input files to be map (url->path) in Node","user":{"login":"geraintluff","id":1957191,"avatar_url":"https://avatars.githubusercontent.com/u/1957191?v=3","gravatar_id":"","url":"https://api.github.com/users/geraintluff","html_url":"https://github.com/geraintluff","followers_url":"https://api.github.com/users/geraintluff/followers","following_url":"https://api.github.com/users/geraintluff/following{/other_user}","gists_url":"https://api.github.com/users/geraintluff/gists{/gist_id}","starred_url":"https://api.github.com/users/geraintluff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraintluff/subscriptions","organizations_url":"https://api.github.com/users/geraintluff/orgs","repos_url":"https://api.github.com/users/geraintluff/repos","events_url":"https://api.github.com/users/geraintluff/events{/privacy}","received_events_url":"https://api.github.com/users/geraintluff/received_events","type":"User","site_admin":false},"body":"The `\"sources\"` array in the sourcemap is currently based on the filename as passed into the module - this makes things difficult if your intended URL structure and folder structure are different.\r\n\r\nThis patch enables use of an object as the `files` argument to Uglify:\r\n\r\n```javascript\r\nvar Uglify = require('uglify-js');\r\nvar result = Uglify.minify({\"/scripts/a.js\": __dirname + \"/static-scripts/a.js\"}, {outSourceMap: true});\r\n```\r\n\r\nFor when order is important, it supports an array of objects, or any mixture of objects and strings:\r\n\r\n```javascript\r\nvar result = Uglify.minify([\r\n    {\"a.js\": \"vendor/a.js\"},\r\n    \"b.js\" // Equivalent to {\"b.js\": \"b.js\"}\r\n], {outSourceMap: true});\r\n```\r\n\r\nIt also works with string code (`fromString`):\r\n\r\n```javascript\r\nvar result = Uglify.minify({\r\n    \"a.js\": \"function A(){...}\",\r\n    \"b.js\": \"function B(){...}\"\r\n}, {\r\n    fromString: true,\r\n    outSourceMap: 'bundle.js.map',\r\n    sourceMapIncludeSources: true /* sourcemap includes the source, with sensible names */\r\n});\r\n```\r\n\r\n_____\r\n\r\n\r\nCurrent workaround: patching the sourcemap after the fact:\r\n\r\n```javascript\r\nvar result = Uglify.minify(['static-scripts/a.js'], {outSourceMap: 'bundle.js.map'});\r\nvar map = JSON.parse(result.map);\r\nmap.sources[0] = '/scripts/a.js';\r\nresult.map = JSON.stringify(map);\r\n```","created_at":"2016-06-27T11:22:19Z","updated_at":"2016-06-27T11:22:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/1173/commits","review_comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/1173/comments","review_comment_url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1173/comments","statuses_url":"https://api.github.com/repos/mishoo/UglifyJS2/statuses/0f8a8e43eff48e045126223fbff2d1b0ef181b31","head":{"label":"geraintluff:master","ref":"master","sha":"0f8a8e43eff48e045126223fbff2d1b0ef181b31","user":{"login":"geraintluff","id":1957191,"avatar_url":"https://avatars.githubusercontent.com/u/1957191?v=3","gravatar_id":"","url":"https://api.github.com/users/geraintluff","html_url":"https://github.com/geraintluff","followers_url":"https://api.github.com/users/geraintluff/followers","following_url":"https://api.github.com/users/geraintluff/following{/other_user}","gists_url":"https://api.github.com/users/geraintluff/gists{/gist_id}","starred_url":"https://api.github.com/users/geraintluff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraintluff/subscriptions","organizations_url":"https://api.github.com/users/geraintluff/orgs","repos_url":"https://api.github.com/users/geraintluff/repos","events_url":"https://api.github.com/users/geraintluff/events{/privacy}","received_events_url":"https://api.github.com/users/geraintluff/received_events","type":"User","site_admin":false},"repo":{"id":62048518,"name":"UglifyJS2","full_name":"geraintluff/UglifyJS2","owner":{"login":"geraintluff","id":1957191,"avatar_url":"https://avatars.githubusercontent.com/u/1957191?v=3","gravatar_id":"","url":"https://api.github.com/users/geraintluff","html_url":"https://github.com/geraintluff","followers_url":"https://api.github.com/users/geraintluff/followers","following_url":"https://api.github.com/users/geraintluff/following{/other_user}","gists_url":"https://api.github.com/users/geraintluff/gists{/gist_id}","starred_url":"https://api.github.com/users/geraintluff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraintluff/subscriptions","organizations_url":"https://api.github.com/users/geraintluff/orgs","repos_url":"https://api.github.com/users/geraintluff/repos","events_url":"https://api.github.com/users/geraintluff/events{/privacy}","received_events_url":"https://api.github.com/users/geraintluff/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/geraintluff/UglifyJS2","description":" JavaScript parser / mangler / compressor / beautifier toolkit","fork":true,"url":"https://api.github.com/repos/geraintluff/UglifyJS2","forks_url":"https://api.github.com/repos/geraintluff/UglifyJS2/forks","keys_url":"https://api.github.com/repos/geraintluff/UglifyJS2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geraintluff/UglifyJS2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geraintluff/UglifyJS2/teams","hooks_url":"https://api.github.com/repos/geraintluff/UglifyJS2/hooks","issue_events_url":"https://api.github.com/repos/geraintluff/UglifyJS2/issues/events{/number}","events_url":"https://api.github.com/repos/geraintluff/UglifyJS2/events","assignees_url":"https://api.github.com/repos/geraintluff/UglifyJS2/assignees{/user}","branches_url":"https://api.github.com/repos/geraintluff/UglifyJS2/branches{/branch}","tags_url":"https://api.github.com/repos/geraintluff/UglifyJS2/tags","blobs_url":"https://api.github.com/repos/geraintluff/UglifyJS2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geraintluff/UglifyJS2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geraintluff/UglifyJS2/git/refs{/sha}","trees_url":"https://api.github.com/repos/geraintluff/UglifyJS2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geraintluff/UglifyJS2/statuses/{sha}","languages_url":"https://api.github.com/repos/geraintluff/UglifyJS2/languages","stargazers_url":"https://api.github.com/repos/geraintluff/UglifyJS2/stargazers","contributors_url":"https://api.github.com/repos/geraintluff/UglifyJS2/contributors","subscribers_url":"https://api.github.com/repos/geraintluff/UglifyJS2/subscribers","subscription_url":"https://api.github.com/repos/geraintluff/UglifyJS2/subscription","commits_url":"https://api.github.com/repos/geraintluff/UglifyJS2/commits{/sha}","git_commits_url":"https://api.github.com/repos/geraintluff/UglifyJS2/git/commits{/sha}","comments_url":"https://api.github.com/repos/geraintluff/UglifyJS2/comments{/number}","issue_comment_url":"https://api.github.com/repos/geraintluff/UglifyJS2/issues/comments{/number}","contents_url":"https://api.github.com/repos/geraintluff/UglifyJS2/contents/{+path}","compare_url":"https://api.github.com/repos/geraintluff/UglifyJS2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geraintluff/UglifyJS2/merges","archive_url":"https://api.github.com/repos/geraintluff/UglifyJS2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geraintluff/UglifyJS2/downloads","issues_url":"https://api.github.com/repos/geraintluff/UglifyJS2/issues{/number}","pulls_url":"https://api.github.com/repos/geraintluff/UglifyJS2/pulls{/number}","milestones_url":"https://api.github.com/repos/geraintluff/UglifyJS2/milestones{/number}","notifications_url":"https://api.github.com/repos/geraintluff/UglifyJS2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geraintluff/UglifyJS2/labels{/name}","releases_url":"https://api.github.com/repos/geraintluff/UglifyJS2/releases{/id}","deployments_url":"https://api.github.com/repos/geraintluff/UglifyJS2/deployments","created_at":"2016-06-27T10:41:26Z","updated_at":"2016-06-27T10:41:27Z","pushed_at":"2016-06-27T11:02:30Z","git_url":"git://github.com/geraintluff/UglifyJS2.git","ssh_url":"git@github.com:geraintluff/UglifyJS2.git","clone_url":"https://github.com/geraintluff/UglifyJS2.git","svn_url":"https://github.com/geraintluff/UglifyJS2","homepage":"http://lisperator.net/uglifyjs/","size":3480,"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":"mishoo:master","ref":"master","sha":"9676167aac715d2dd10918e2beb13b1a4a372616","user":{"login":"mishoo","id":334725,"avatar_url":"https://avatars.githubusercontent.com/u/334725?v=3","gravatar_id":"","url":"https://api.github.com/users/mishoo","html_url":"https://github.com/mishoo","followers_url":"https://api.github.com/users/mishoo/followers","following_url":"https://api.github.com/users/mishoo/following{/other_user}","gists_url":"https://api.github.com/users/mishoo/gists{/gist_id}","starred_url":"https://api.github.com/users/mishoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishoo/subscriptions","organizations_url":"https://api.github.com/users/mishoo/orgs","repos_url":"https://api.github.com/users/mishoo/repos","events_url":"https://api.github.com/users/mishoo/events{/privacy}","received_events_url":"https://api.github.com/users/mishoo/received_events","type":"User","site_admin":false},"repo":{"id":5569059,"name":"UglifyJS2","full_name":"mishoo/UglifyJS2","owner":{"login":"mishoo","id":334725,"avatar_url":"https://avatars.githubusercontent.com/u/334725?v=3","gravatar_id":"","url":"https://api.github.com/users/mishoo","html_url":"https://github.com/mishoo","followers_url":"https://api.github.com/users/mishoo/followers","following_url":"https://api.github.com/users/mishoo/following{/other_user}","gists_url":"https://api.github.com/users/mishoo/gists{/gist_id}","starred_url":"https://api.github.com/users/mishoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishoo/subscriptions","organizations_url":"https://api.github.com/users/mishoo/orgs","repos_url":"https://api.github.com/users/mishoo/repos","events_url":"https://api.github.com/users/mishoo/events{/privacy}","received_events_url":"https://api.github.com/users/mishoo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mishoo/UglifyJS2","description":" JavaScript parser / mangler / compressor / beautifier toolkit","fork":false,"url":"https://api.github.com/repos/mishoo/UglifyJS2","forks_url":"https://api.github.com/repos/mishoo/UglifyJS2/forks","keys_url":"https://api.github.com/repos/mishoo/UglifyJS2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mishoo/UglifyJS2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mishoo/UglifyJS2/teams","hooks_url":"https://api.github.com/repos/mishoo/UglifyJS2/hooks","issue_events_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/events{/number}","events_url":"https://api.github.com/repos/mishoo/UglifyJS2/events","assignees_url":"https://api.github.com/repos/mishoo/UglifyJS2/assignees{/user}","branches_url":"https://api.github.com/repos/mishoo/UglifyJS2/branches{/branch}","tags_url":"https://api.github.com/repos/mishoo/UglifyJS2/tags","blobs_url":"https://api.github.com/repos/mishoo/UglifyJS2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mishoo/UglifyJS2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mishoo/UglifyJS2/git/refs{/sha}","trees_url":"https://api.github.com/repos/mishoo/UglifyJS2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mishoo/UglifyJS2/statuses/{sha}","languages_url":"https://api.github.com/repos/mishoo/UglifyJS2/languages","stargazers_url":"https://api.github.com/repos/mishoo/UglifyJS2/stargazers","contributors_url":"https://api.github.com/repos/mishoo/UglifyJS2/contributors","subscribers_url":"https://api.github.com/repos/mishoo/UglifyJS2/subscribers","subscription_url":"https://api.github.com/repos/mishoo/UglifyJS2/subscription","commits_url":"https://api.github.com/repos/mishoo/UglifyJS2/commits{/sha}","git_commits_url":"https://api.github.com/repos/mishoo/UglifyJS2/git/commits{/sha}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/comments{/number}","issue_comment_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/comments{/number}","contents_url":"https://api.github.com/repos/mishoo/UglifyJS2/contents/{+path}","compare_url":"https://api.github.com/repos/mishoo/UglifyJS2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mishoo/UglifyJS2/merges","archive_url":"https://api.github.com/repos/mishoo/UglifyJS2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mishoo/UglifyJS2/downloads","issues_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues{/number}","pulls_url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls{/number}","milestones_url":"https://api.github.com/repos/mishoo/UglifyJS2/milestones{/number}","notifications_url":"https://api.github.com/repos/mishoo/UglifyJS2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mishoo/UglifyJS2/labels{/name}","releases_url":"https://api.github.com/repos/mishoo/UglifyJS2/releases{/id}","deployments_url":"https://api.github.com/repos/mishoo/UglifyJS2/deployments","created_at":"2012-08-27T09:31:03Z","updated_at":"2016-06-27T11:00:42Z","pushed_at":"2016-06-27T10:46:11Z","git_url":"git://github.com/mishoo/UglifyJS2.git","ssh_url":"git@github.com:mishoo/UglifyJS2.git","clone_url":"https://github.com/mishoo/UglifyJS2.git","svn_url":"https://github.com/mishoo/UglifyJS2","homepage":"http://lisperator.net/uglifyjs/","size":3480,"stargazers_count":4981,"watchers_count":4981,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":552,"mirror_url":null,"open_issues_count":254,"forks":552,"open_issues":254,"watchers":4981,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/1173"},"html":{"href":"https://github.com/mishoo/UglifyJS2/pull/1173"},"issue":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1173"},"comments":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1173/comments"},"review_comments":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/1173/comments"},"review_comment":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/1173/commits"},"statuses":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/statuses/0f8a8e43eff48e045126223fbff2d1b0ef181b31"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":12,"deletions":5,"changed_files":1}}
{"actor":{"display_login":"geraintluff"}}