{"action":"created","comment":{"url":"https://api.github.com/repos/ecomfe/edp-build/pulls/comments/28253163","id":28253163,"diff_hunk":"@@ -44,73 +82,24 @@ Html2JsCompiler.prototype.name = 'Html2JsCompiler';\n  * @param {Function} callback 处理完成回调函数\n  */\n Html2JsCompiler.prototype.process =\n-    function ( file, processContext, callback ) {\n-\n-    // 第一次 2js 会修改 file.extname\n-    // 所以这里自己判断\n-    var extname = (/[.]/.exec(file.fullPath))\n-        ? /[^.]+$/.exec(file.fullPath.toLowerCase())\n-        : '';\n-\n-    if ( this.extnames[extname] ) {\n-\n-        var fs = require('fs');\n-\n-        var fileSrcPath = file.fullPath + '.js';\n-\n-        if( this.clean ) {\n-\n-            if ( fs.existsSync( fileSrcPath ) ){\n+    function (file, processContext, callback) {\n \n-                fs.unlinkSync( fileSrcPath );\n+        // 按 后缀名 读\n+        if (this.extnames[file.extname]) {","path":"lib/processor/html2js-compiler.js","position":110,"original_position":110,"commit_id":"39b576cd7abb22773ffb07937c0563d8b97438ac","original_commit_id":"39b576cd7abb22773ffb07937c0563d8b97438ac","user":{"login":"leeight","id":104052,"avatar_url":"https://avatars.githubusercontent.com/u/104052?v=3","gravatar_id":"","url":"https://api.github.com/users/leeight","html_url":"https://github.com/leeight","followers_url":"https://api.github.com/users/leeight/followers","following_url":"https://api.github.com/users/leeight/following{/other_user}","gists_url":"https://api.github.com/users/leeight/gists{/gist_id}","starred_url":"https://api.github.com/users/leeight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeight/subscriptions","organizations_url":"https://api.github.com/users/leeight/orgs","repos_url":"https://api.github.com/users/leeight/repos","events_url":"https://api.github.com/users/leeight/events{/privacy}","received_events_url":"https://api.github.com/users/leeight/received_events","type":"User","site_admin":false},"body":"是的，我的意思是保留 extnames 的配置，在 constructor 里面处理一下？\r\n\r\n```\r\nthis.files = extnames.map(function (item) { '*.' + item;});\r\n```","created_at":"2015-04-13T16:21:03Z","updated_at":"2015-04-13T16:21:03Z","html_url":"https://github.com/ecomfe/edp-build/pull/84#discussion_r28253163","pull_request_url":"https://api.github.com/repos/ecomfe/edp-build/pulls/84","_links":{"self":{"href":"https://api.github.com/repos/ecomfe/edp-build/pulls/comments/28253163"},"html":{"href":"https://github.com/ecomfe/edp-build/pull/84#discussion_r28253163"},"pull_request":{"href":"https://api.github.com/repos/ecomfe/edp-build/pulls/84"}}},"pull_request":{"url":"https://api.github.com/repos/ecomfe/edp-build/pulls/84","id":33159232,"html_url":"https://github.com/ecomfe/edp-build/pull/84","diff_url":"https://github.com/ecomfe/edp-build/pull/84.diff","patch_url":"https://github.com/ecomfe/edp-build/pull/84.patch","issue_url":"https://api.github.com/repos/ecomfe/edp-build/issues/84","number":84,"state":"open","locked":false,"title":"html2js add keepSource","user":{"login":"junmer","id":3205092,"avatar_url":"https://avatars.githubusercontent.com/u/3205092?v=3","gravatar_id":"","url":"https://api.github.com/users/junmer","html_url":"https://github.com/junmer","followers_url":"https://api.github.com/users/junmer/followers","following_url":"https://api.github.com/users/junmer/following{/other_user}","gists_url":"https://api.github.com/users/junmer/gists{/gist_id}","starred_url":"https://api.github.com/users/junmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junmer/subscriptions","organizations_url":"https://api.github.com/users/junmer/orgs","repos_url":"https://api.github.com/users/junmer/repos","events_url":"https://api.github.com/users/junmer/events{/privacy}","received_events_url":"https://api.github.com/users/junmer/received_events","type":"User","site_admin":false},"body":"应 @huanghuiquan 的需求，增加配置项 keepSource\r\n\r\n原来：\r\n`xxx.html` -> `xxx.html.js`\r\n\r\n keepSource：\r\n`xxx.html` -> `xxx.html.js`, `xxx.html`\r\n\r\n","created_at":"2015-04-13T12:33:35Z","updated_at":"2015-04-13T16:21:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ecomfe/edp-build/pulls/84/commits","review_comments_url":"https://api.github.com/repos/ecomfe/edp-build/pulls/84/comments","review_comment_url":"https://api.github.com/repos/ecomfe/edp-build/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ecomfe/edp-build/issues/84/comments","statuses_url":"https://api.github.com/repos/ecomfe/edp-build/statuses/39b576cd7abb22773ffb07937c0563d8b97438ac","head":{"label":"junmer:html2js","ref":"html2js","sha":"39b576cd7abb22773ffb07937c0563d8b97438ac","user":{"login":"junmer","id":3205092,"avatar_url":"https://avatars.githubusercontent.com/u/3205092?v=3","gravatar_id":"","url":"https://api.github.com/users/junmer","html_url":"https://github.com/junmer","followers_url":"https://api.github.com/users/junmer/followers","following_url":"https://api.github.com/users/junmer/following{/other_user}","gists_url":"https://api.github.com/users/junmer/gists{/gist_id}","starred_url":"https://api.github.com/users/junmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junmer/subscriptions","organizations_url":"https://api.github.com/users/junmer/orgs","repos_url":"https://api.github.com/users/junmer/repos","events_url":"https://api.github.com/users/junmer/events{/privacy}","received_events_url":"https://api.github.com/users/junmer/received_events","type":"User","site_admin":false},"repo":{"id":19102616,"name":"edp-build","full_name":"junmer/edp-build","owner":{"login":"junmer","id":3205092,"avatar_url":"https://avatars.githubusercontent.com/u/3205092?v=3","gravatar_id":"","url":"https://api.github.com/users/junmer","html_url":"https://github.com/junmer","followers_url":"https://api.github.com/users/junmer/followers","following_url":"https://api.github.com/users/junmer/following{/other_user}","gists_url":"https://api.github.com/users/junmer/gists{/gist_id}","starred_url":"https://api.github.com/users/junmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junmer/subscriptions","organizations_url":"https://api.github.com/users/junmer/orgs","repos_url":"https://api.github.com/users/junmer/repos","events_url":"https://api.github.com/users/junmer/events{/privacy}","received_events_url":"https://api.github.com/users/junmer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/junmer/edp-build","description":"Package for edp build.","fork":true,"url":"https://api.github.com/repos/junmer/edp-build","forks_url":"https://api.github.com/repos/junmer/edp-build/forks","keys_url":"https://api.github.com/repos/junmer/edp-build/keys{/key_id}","collaborators_url":"https://api.github.com/repos/junmer/edp-build/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/junmer/edp-build/teams","hooks_url":"https://api.github.com/repos/junmer/edp-build/hooks","issue_events_url":"https://api.github.com/repos/junmer/edp-build/issues/events{/number}","events_url":"https://api.github.com/repos/junmer/edp-build/events","assignees_url":"https://api.github.com/repos/junmer/edp-build/assignees{/user}","branches_url":"https://api.github.com/repos/junmer/edp-build/branches{/branch}","tags_url":"https://api.github.com/repos/junmer/edp-build/tags","blobs_url":"https://api.github.com/repos/junmer/edp-build/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/junmer/edp-build/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/junmer/edp-build/git/refs{/sha}","trees_url":"https://api.github.com/repos/junmer/edp-build/git/trees{/sha}","statuses_url":"https://api.github.com/repos/junmer/edp-build/statuses/{sha}","languages_url":"https://api.github.com/repos/junmer/edp-build/languages","stargazers_url":"https://api.github.com/repos/junmer/edp-build/stargazers","contributors_url":"https://api.github.com/repos/junmer/edp-build/contributors","subscribers_url":"https://api.github.com/repos/junmer/edp-build/subscribers","subscription_url":"https://api.github.com/repos/junmer/edp-build/subscription","commits_url":"https://api.github.com/repos/junmer/edp-build/commits{/sha}","git_commits_url":"https://api.github.com/repos/junmer/edp-build/git/commits{/sha}","comments_url":"https://api.github.com/repos/junmer/edp-build/comments{/number}","issue_comment_url":"https://api.github.com/repos/junmer/edp-build/issues/comments{/number}","contents_url":"https://api.github.com/repos/junmer/edp-build/contents/{+path}","compare_url":"https://api.github.com/repos/junmer/edp-build/compare/{base}...{head}","merges_url":"https://api.github.com/repos/junmer/edp-build/merges","archive_url":"https://api.github.com/repos/junmer/edp-build/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/junmer/edp-build/downloads","issues_url":"https://api.github.com/repos/junmer/edp-build/issues{/number}","pulls_url":"https://api.github.com/repos/junmer/edp-build/pulls{/number}","milestones_url":"https://api.github.com/repos/junmer/edp-build/milestones{/number}","notifications_url":"https://api.github.com/repos/junmer/edp-build/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/junmer/edp-build/labels{/name}","releases_url":"https://api.github.com/repos/junmer/edp-build/releases{/id}","created_at":"2014-04-24T09:15:45Z","updated_at":"2015-04-13T12:31:10Z","pushed_at":"2015-04-13T15:41:35Z","git_url":"git://github.com/junmer/edp-build.git","ssh_url":"git@github.com:junmer/edp-build.git","clone_url":"https://github.com/junmer/edp-build.git","svn_url":"https://github.com/junmer/edp-build","homepage":"","size":600,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"ecomfe:1.0/develop","ref":"1.0/develop","sha":"2e9b49f43f7df75cc214414aea72a38fc41feb76","user":{"login":"ecomfe","id":2268460,"avatar_url":"https://avatars.githubusercontent.com/u/2268460?v=3","gravatar_id":"","url":"https://api.github.com/users/ecomfe","html_url":"https://github.com/ecomfe","followers_url":"https://api.github.com/users/ecomfe/followers","following_url":"https://api.github.com/users/ecomfe/following{/other_user}","gists_url":"https://api.github.com/users/ecomfe/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomfe/subscriptions","organizations_url":"https://api.github.com/users/ecomfe/orgs","repos_url":"https://api.github.com/users/ecomfe/repos","events_url":"https://api.github.com/users/ecomfe/events{/privacy}","received_events_url":"https://api.github.com/users/ecomfe/received_events","type":"Organization","site_admin":false},"repo":{"id":10994705,"name":"edp-build","full_name":"ecomfe/edp-build","owner":{"login":"ecomfe","id":2268460,"avatar_url":"https://avatars.githubusercontent.com/u/2268460?v=3","gravatar_id":"","url":"https://api.github.com/users/ecomfe","html_url":"https://github.com/ecomfe","followers_url":"https://api.github.com/users/ecomfe/followers","following_url":"https://api.github.com/users/ecomfe/following{/other_user}","gists_url":"https://api.github.com/users/ecomfe/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomfe/subscriptions","organizations_url":"https://api.github.com/users/ecomfe/orgs","repos_url":"https://api.github.com/users/ecomfe/repos","events_url":"https://api.github.com/users/ecomfe/events{/privacy}","received_events_url":"https://api.github.com/users/ecomfe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ecomfe/edp-build","description":"Package for edp build.","fork":false,"url":"https://api.github.com/repos/ecomfe/edp-build","forks_url":"https://api.github.com/repos/ecomfe/edp-build/forks","keys_url":"https://api.github.com/repos/ecomfe/edp-build/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ecomfe/edp-build/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ecomfe/edp-build/teams","hooks_url":"https://api.github.com/repos/ecomfe/edp-build/hooks","issue_events_url":"https://api.github.com/repos/ecomfe/edp-build/issues/events{/number}","events_url":"https://api.github.com/repos/ecomfe/edp-build/events","assignees_url":"https://api.github.com/repos/ecomfe/edp-build/assignees{/user}","branches_url":"https://api.github.com/repos/ecomfe/edp-build/branches{/branch}","tags_url":"https://api.github.com/repos/ecomfe/edp-build/tags","blobs_url":"https://api.github.com/repos/ecomfe/edp-build/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ecomfe/edp-build/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ecomfe/edp-build/git/refs{/sha}","trees_url":"https://api.github.com/repos/ecomfe/edp-build/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ecomfe/edp-build/statuses/{sha}","languages_url":"https://api.github.com/repos/ecomfe/edp-build/languages","stargazers_url":"https://api.github.com/repos/ecomfe/edp-build/stargazers","contributors_url":"https://api.github.com/repos/ecomfe/edp-build/contributors","subscribers_url":"https://api.github.com/repos/ecomfe/edp-build/subscribers","subscription_url":"https://api.github.com/repos/ecomfe/edp-build/subscription","commits_url":"https://api.github.com/repos/ecomfe/edp-build/commits{/sha}","git_commits_url":"https://api.github.com/repos/ecomfe/edp-build/git/commits{/sha}","comments_url":"https://api.github.com/repos/ecomfe/edp-build/comments{/number}","issue_comment_url":"https://api.github.com/repos/ecomfe/edp-build/issues/comments{/number}","contents_url":"https://api.github.com/repos/ecomfe/edp-build/contents/{+path}","compare_url":"https://api.github.com/repos/ecomfe/edp-build/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ecomfe/edp-build/merges","archive_url":"https://api.github.com/repos/ecomfe/edp-build/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ecomfe/edp-build/downloads","issues_url":"https://api.github.com/repos/ecomfe/edp-build/issues{/number}","pulls_url":"https://api.github.com/repos/ecomfe/edp-build/pulls{/number}","milestones_url":"https://api.github.com/repos/ecomfe/edp-build/milestones{/number}","notifications_url":"https://api.github.com/repos/ecomfe/edp-build/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ecomfe/edp-build/labels{/name}","releases_url":"https://api.github.com/repos/ecomfe/edp-build/releases{/id}","created_at":"2013-06-27T11:06:27Z","updated_at":"2014-09-24T03:04:53Z","pushed_at":"2015-04-13T15:41:36Z","git_url":"git://github.com/ecomfe/edp-build.git","ssh_url":"git@github.com:ecomfe/edp-build.git","clone_url":"https://github.com/ecomfe/edp-build.git","svn_url":"https://github.com/ecomfe/edp-build","homepage":"","size":2101,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":15,"forks":19,"open_issues":15,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ecomfe/edp-build/pulls/84"},"html":{"href":"https://github.com/ecomfe/edp-build/pull/84"},"issue":{"href":"https://api.github.com/repos/ecomfe/edp-build/issues/84"},"comments":{"href":"https://api.github.com/repos/ecomfe/edp-build/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/ecomfe/edp-build/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/ecomfe/edp-build/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ecomfe/edp-build/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/ecomfe/edp-build/statuses/39b576cd7abb22773ffb07937c0563d8b97438ac"}}}}