{"action":"created","comment":{"url":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/comments/38777866","id":38777866,"diff_hunk":"@@ -59,33 +63,60 @@ module.exports = require('enb/lib/build-flow').create()\n     .useFileList(['vanilla.js', 'js', 'browser.js'])\n     .defineOption('iife', false)\n     .defineOption('compress', false)\n-    .wrapper(function (str) {\n-        if (this._compress) {\n-            return minify(str, { fromString: true }).code;\n-        }\n+    .defineOption('sourcemap', false)\n+    .builder(function (sourceFiles) {\n+        return this._readSourceFiles(sourceFiles)\n+            .then(function (sources) {\n+                var file = new File(this.node.resolvePath(this._target), { sourceMap: this._sourcemap }),\n+                    needWrapIIFE = this._iife,\n+                    needToAddComments = !this._compress,\n+                    compressOptions = { fromString: true },\n+                    compressed;\n \n-        return str;\n-    })\n-    .justJoinFiles(function (filename, contents) {\n-        var relPath = this.node.relativePath(filename);\n+                sources.forEach(function (source) {\n+                    needToAddComments && file.writeLine('/* begin: ' + source.relPath + ' */');\n+                    needWrapIIFE && file.writeLine('(function(){');\n+                    file.writeFileContent(source.path, source.contents);\n+                    needWrapIIFE && file.writeLine('}());');\n+                    needToAddComments && file.writeLine('/* end: ' + source.relPath + ' */');\n+                });\n \n-        if (this._iife) {\n-            contents = [\n-                '(function(){',\n-                contents,\n-                '}());'\n-            ].join(EOL);\n-        }\n+                if (!this._compress) {\n+                    return file.render();\n+                }\n \n-        // after compression comments will be removed\n-        if (!this._compress) {\n-            contents = [\n-                '/* begin: ' + relPath + ' */',\n-                contents,\n-                '/* end: ' + relPath + ' *' + '/'\n-            ].join(EOL);\n-        }\n+                if (!this._sourcemap) {\n+                    return minify(file.render(), compressOptions).code;\n+                }\n \n-        return contents;\n+                compressOptions.inSourceMap = file.getSourceMap();\n+                compressOptions.outSourceMap = 'minified.js.map';","path":"techs/browser-js.js","position":74,"original_position":74,"commit_id":"ab16ff41c8ee0e2e5d62395f36846f150032be4e","original_commit_id":"ab16ff41c8ee0e2e5d62395f36846f150032be4e","user":{"login":"blond","id":2225579,"avatar_url":"https://avatars.githubusercontent.com/u/2225579?v=3","gravatar_id":"","url":"https://api.github.com/users/blond","html_url":"https://github.com/blond","followers_url":"https://api.github.com/users/blond/followers","following_url":"https://api.github.com/users/blond/following{/other_user}","gists_url":"https://api.github.com/users/blond/gists{/gist_id}","starred_url":"https://api.github.com/users/blond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blond/subscriptions","organizations_url":"https://api.github.com/users/blond/orgs","repos_url":"https://api.github.com/users/blond/repos","events_url":"https://api.github.com/users/blond/events{/privacy}","received_events_url":"https://api.github.com/users/blond/received_events","type":"User","site_admin":false},"body":"Почему не `this._target + '.map'`?","created_at":"2015-09-04T18:00:47Z","updated_at":"2015-09-04T18:00:47Z","html_url":"https://github.com/enb-make/enb-diverse-js/pull/34#discussion_r38777866","pull_request_url":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/comments/38777866"},"html":{"href":"https://github.com/enb-make/enb-diverse-js/pull/34#discussion_r38777866"},"pull_request":{"href":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/34","id":43636027,"html_url":"https://github.com/enb-make/enb-diverse-js/pull/34","diff_url":"https://github.com/enb-make/enb-diverse-js/pull/34.diff","patch_url":"https://github.com/enb-make/enb-diverse-js/pull/34.patch","issue_url":"https://api.github.com/repos/enb-make/enb-diverse-js/issues/34","number":34,"state":"open","locked":false,"title":"#12 Add sourcemap option to browser-js technology","user":{"login":"tormozz48","id":996162,"avatar_url":"https://avatars.githubusercontent.com/u/996162?v=3","gravatar_id":"","url":"https://api.github.com/users/tormozz48","html_url":"https://github.com/tormozz48","followers_url":"https://api.github.com/users/tormozz48/followers","following_url":"https://api.github.com/users/tormozz48/following{/other_user}","gists_url":"https://api.github.com/users/tormozz48/gists{/gist_id}","starred_url":"https://api.github.com/users/tormozz48/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tormozz48/subscriptions","organizations_url":"https://api.github.com/users/tormozz48/orgs","repos_url":"https://api.github.com/users/tormozz48/repos","events_url":"https://api.github.com/users/tormozz48/events{/privacy}","received_events_url":"https://api.github.com/users/tormozz48/received_events","type":"User","site_admin":false},"body":"Resolved #12 \r\n\r\n@blond @j0tunn \r\nPlease review it","created_at":"2015-08-28T14:51:03Z","updated_at":"2015-09-04T18:00:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"695be6ef6269496f5712cbf235f66f861673716d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/34/commits","review_comments_url":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/34/comments","review_comment_url":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/enb-make/enb-diverse-js/issues/34/comments","statuses_url":"https://api.github.com/repos/enb-make/enb-diverse-js/statuses/ab16ff41c8ee0e2e5d62395f36846f150032be4e","head":{"label":"enb-make:issue-12","ref":"issue-12","sha":"ab16ff41c8ee0e2e5d62395f36846f150032be4e","user":{"login":"enb-make","id":4427117,"avatar_url":"https://avatars.githubusercontent.com/u/4427117?v=3","gravatar_id":"","url":"https://api.github.com/users/enb-make","html_url":"https://github.com/enb-make","followers_url":"https://api.github.com/users/enb-make/followers","following_url":"https://api.github.com/users/enb-make/following{/other_user}","gists_url":"https://api.github.com/users/enb-make/gists{/gist_id}","starred_url":"https://api.github.com/users/enb-make/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enb-make/subscriptions","organizations_url":"https://api.github.com/users/enb-make/orgs","repos_url":"https://api.github.com/users/enb-make/repos","events_url":"https://api.github.com/users/enb-make/events{/privacy}","received_events_url":"https://api.github.com/users/enb-make/received_events","type":"Organization","site_admin":false},"repo":{"id":15278577,"name":"enb-diverse-js","full_name":"enb-make/enb-diverse-js","owner":{"login":"enb-make","id":4427117,"avatar_url":"https://avatars.githubusercontent.com/u/4427117?v=3","gravatar_id":"","url":"https://api.github.com/users/enb-make","html_url":"https://github.com/enb-make","followers_url":"https://api.github.com/users/enb-make/followers","following_url":"https://api.github.com/users/enb-make/following{/other_user}","gists_url":"https://api.github.com/users/enb-make/gists{/gist_id}","starred_url":"https://api.github.com/users/enb-make/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enb-make/subscriptions","organizations_url":"https://api.github.com/users/enb-make/orgs","repos_url":"https://api.github.com/users/enb-make/repos","events_url":"https://api.github.com/users/enb-make/events{/privacy}","received_events_url":"https://api.github.com/users/enb-make/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enb-make/enb-diverse-js","description":"Diverse js techs: vanilla + browser + node","fork":false,"url":"https://api.github.com/repos/enb-make/enb-diverse-js","forks_url":"https://api.github.com/repos/enb-make/enb-diverse-js/forks","keys_url":"https://api.github.com/repos/enb-make/enb-diverse-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enb-make/enb-diverse-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enb-make/enb-diverse-js/teams","hooks_url":"https://api.github.com/repos/enb-make/enb-diverse-js/hooks","issue_events_url":"https://api.github.com/repos/enb-make/enb-diverse-js/issues/events{/number}","events_url":"https://api.github.com/repos/enb-make/enb-diverse-js/events","assignees_url":"https://api.github.com/repos/enb-make/enb-diverse-js/assignees{/user}","branches_url":"https://api.github.com/repos/enb-make/enb-diverse-js/branches{/branch}","tags_url":"https://api.github.com/repos/enb-make/enb-diverse-js/tags","blobs_url":"https://api.github.com/repos/enb-make/enb-diverse-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enb-make/enb-diverse-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enb-make/enb-diverse-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/enb-make/enb-diverse-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enb-make/enb-diverse-js/statuses/{sha}","languages_url":"https://api.github.com/repos/enb-make/enb-diverse-js/languages","stargazers_url":"https://api.github.com/repos/enb-make/enb-diverse-js/stargazers","contributors_url":"https://api.github.com/repos/enb-make/enb-diverse-js/contributors","subscribers_url":"https://api.github.com/repos/enb-make/enb-diverse-js/subscribers","subscription_url":"https://api.github.com/repos/enb-make/enb-diverse-js/subscription","commits_url":"https://api.github.com/repos/enb-make/enb-diverse-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/enb-make/enb-diverse-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/enb-make/enb-diverse-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/enb-make/enb-diverse-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/enb-make/enb-diverse-js/contents/{+path}","compare_url":"https://api.github.com/repos/enb-make/enb-diverse-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enb-make/enb-diverse-js/merges","archive_url":"https://api.github.com/repos/enb-make/enb-diverse-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enb-make/enb-diverse-js/downloads","issues_url":"https://api.github.com/repos/enb-make/enb-diverse-js/issues{/number}","pulls_url":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls{/number}","milestones_url":"https://api.github.com/repos/enb-make/enb-diverse-js/milestones{/number}","notifications_url":"https://api.github.com/repos/enb-make/enb-diverse-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enb-make/enb-diverse-js/labels{/name}","releases_url":"https://api.github.com/repos/enb-make/enb-diverse-js/releases{/id}","created_at":"2013-12-18T09:09:57Z","updated_at":"2015-08-02T18:17:48Z","pushed_at":"2015-09-04T14:45:41Z","git_url":"git://github.com/enb-make/enb-diverse-js.git","ssh_url":"git@github.com:enb-make/enb-diverse-js.git","clone_url":"https://github.com/enb-make/enb-diverse-js.git","svn_url":"https://github.com/enb-make/enb-diverse-js","homepage":null,"size":380,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":12,"default_branch":"master"}},"base":{"label":"enb-make:master","ref":"master","sha":"3a473374b3c3e8c2fb7c8c2df5a6fbd4dc031d5c","user":{"login":"enb-make","id":4427117,"avatar_url":"https://avatars.githubusercontent.com/u/4427117?v=3","gravatar_id":"","url":"https://api.github.com/users/enb-make","html_url":"https://github.com/enb-make","followers_url":"https://api.github.com/users/enb-make/followers","following_url":"https://api.github.com/users/enb-make/following{/other_user}","gists_url":"https://api.github.com/users/enb-make/gists{/gist_id}","starred_url":"https://api.github.com/users/enb-make/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enb-make/subscriptions","organizations_url":"https://api.github.com/users/enb-make/orgs","repos_url":"https://api.github.com/users/enb-make/repos","events_url":"https://api.github.com/users/enb-make/events{/privacy}","received_events_url":"https://api.github.com/users/enb-make/received_events","type":"Organization","site_admin":false},"repo":{"id":15278577,"name":"enb-diverse-js","full_name":"enb-make/enb-diverse-js","owner":{"login":"enb-make","id":4427117,"avatar_url":"https://avatars.githubusercontent.com/u/4427117?v=3","gravatar_id":"","url":"https://api.github.com/users/enb-make","html_url":"https://github.com/enb-make","followers_url":"https://api.github.com/users/enb-make/followers","following_url":"https://api.github.com/users/enb-make/following{/other_user}","gists_url":"https://api.github.com/users/enb-make/gists{/gist_id}","starred_url":"https://api.github.com/users/enb-make/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enb-make/subscriptions","organizations_url":"https://api.github.com/users/enb-make/orgs","repos_url":"https://api.github.com/users/enb-make/repos","events_url":"https://api.github.com/users/enb-make/events{/privacy}","received_events_url":"https://api.github.com/users/enb-make/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enb-make/enb-diverse-js","description":"Diverse js techs: vanilla + browser + node","fork":false,"url":"https://api.github.com/repos/enb-make/enb-diverse-js","forks_url":"https://api.github.com/repos/enb-make/enb-diverse-js/forks","keys_url":"https://api.github.com/repos/enb-make/enb-diverse-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enb-make/enb-diverse-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enb-make/enb-diverse-js/teams","hooks_url":"https://api.github.com/repos/enb-make/enb-diverse-js/hooks","issue_events_url":"https://api.github.com/repos/enb-make/enb-diverse-js/issues/events{/number}","events_url":"https://api.github.com/repos/enb-make/enb-diverse-js/events","assignees_url":"https://api.github.com/repos/enb-make/enb-diverse-js/assignees{/user}","branches_url":"https://api.github.com/repos/enb-make/enb-diverse-js/branches{/branch}","tags_url":"https://api.github.com/repos/enb-make/enb-diverse-js/tags","blobs_url":"https://api.github.com/repos/enb-make/enb-diverse-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enb-make/enb-diverse-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enb-make/enb-diverse-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/enb-make/enb-diverse-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enb-make/enb-diverse-js/statuses/{sha}","languages_url":"https://api.github.com/repos/enb-make/enb-diverse-js/languages","stargazers_url":"https://api.github.com/repos/enb-make/enb-diverse-js/stargazers","contributors_url":"https://api.github.com/repos/enb-make/enb-diverse-js/contributors","subscribers_url":"https://api.github.com/repos/enb-make/enb-diverse-js/subscribers","subscription_url":"https://api.github.com/repos/enb-make/enb-diverse-js/subscription","commits_url":"https://api.github.com/repos/enb-make/enb-diverse-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/enb-make/enb-diverse-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/enb-make/enb-diverse-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/enb-make/enb-diverse-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/enb-make/enb-diverse-js/contents/{+path}","compare_url":"https://api.github.com/repos/enb-make/enb-diverse-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enb-make/enb-diverse-js/merges","archive_url":"https://api.github.com/repos/enb-make/enb-diverse-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enb-make/enb-diverse-js/downloads","issues_url":"https://api.github.com/repos/enb-make/enb-diverse-js/issues{/number}","pulls_url":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls{/number}","milestones_url":"https://api.github.com/repos/enb-make/enb-diverse-js/milestones{/number}","notifications_url":"https://api.github.com/repos/enb-make/enb-diverse-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enb-make/enb-diverse-js/labels{/name}","releases_url":"https://api.github.com/repos/enb-make/enb-diverse-js/releases{/id}","created_at":"2013-12-18T09:09:57Z","updated_at":"2015-08-02T18:17:48Z","pushed_at":"2015-09-04T14:45:41Z","git_url":"git://github.com/enb-make/enb-diverse-js.git","ssh_url":"git@github.com:enb-make/enb-diverse-js.git","clone_url":"https://github.com/enb-make/enb-diverse-js.git","svn_url":"https://github.com/enb-make/enb-diverse-js","homepage":null,"size":380,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/34"},"html":{"href":"https://github.com/enb-make/enb-diverse-js/pull/34"},"issue":{"href":"https://api.github.com/repos/enb-make/enb-diverse-js/issues/34"},"comments":{"href":"https://api.github.com/repos/enb-make/enb-diverse-js/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/enb-make/enb-diverse-js/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/enb-make/enb-diverse-js/statuses/ab16ff41c8ee0e2e5d62395f36846f150032be4e"}}}}