{"action":"created","comment":{"url":"https://api.github.com/repos/alibaba/rax/pulls/comments/244908972","pull_request_review_id":188896256,"id":244908972,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDkwODk3Mg==","diff_hunk":"@@ -0,0 +1,77 @@\n+/* eslint-disable no-console */\n+const HtmlWebpackPlugin = require('html-webpack-plugin');\n+const ManifestPlugin = require('webpack-manifest-plugin');\n+const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');\n+const UglifyJsPlugin = require('uglifyjs-webpack-plugin');\n+const webpackMerge = require('webpack-merge');\n+\n+const pathConfig = require('../path.config');\n+const webpackConfigBase = require('./webpack.config.base');\n+\n+const registerServiceWorker = `<script>\n+if ('serviceWorker' in navigator) {\n+  window.addEventListener('load', () => {\n+    navigator.serviceWorker.register('${process.env.PUBLIC_PATH}service-worker.js').then(registration => {\n+      console.log('SW registered');\n+    }).catch(registrationError => {\n+      console.log('SW registration failed: ', registrationError);\n+    });\n+  });\n+}\n+</script>`;\n+\n+const webpackConfigProd = webpackMerge(webpackConfigBase, {\n+  devtool: process.env.DEBUG ? 'module-source-map' : 'none',","path":"packages/rax-scripts/src/config/miniprogram/webpack.config.prod.js","position":null,"original_position":24,"commit_id":"aa50cd38c07eadc9fa4f4c39a284c3a0a9573da2","original_commit_id":"87b16c59547f050ad9c7d0b84f4db8ad34a4222b","user":{"login":"yuanyan","id":677114,"node_id":"MDQ6VXNlcjY3NzExNA==","avatar_url":"https://avatars1.githubusercontent.com/u/677114?v=4","gravatar_id":"","url":"https://api.github.com/users/yuanyan","html_url":"https://github.com/yuanyan","followers_url":"https://api.github.com/users/yuanyan/followers","following_url":"https://api.github.com/users/yuanyan/following{/other_user}","gists_url":"https://api.github.com/users/yuanyan/gists{/gist_id}","starred_url":"https://api.github.com/users/yuanyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuanyan/subscriptions","organizations_url":"https://api.github.com/users/yuanyan/orgs","repos_url":"https://api.github.com/users/yuanyan/repos","events_url":"https://api.github.com/users/yuanyan/events{/privacy}","received_events_url":"https://api.github.com/users/yuanyan/received_events","type":"User","site_admin":false},"body":"应该是 NODE_ENV 来判断环境","created_at":"2019-01-03T03:54:52Z","updated_at":"2019-01-03T03:54:52Z","html_url":"https://github.com/alibaba/rax/pull/835#discussion_r244908972","pull_request_url":"https://api.github.com/repos/alibaba/rax/pulls/835","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/alibaba/rax/pulls/comments/244908972"},"html":{"href":"https://github.com/alibaba/rax/pull/835#discussion_r244908972"},"pull_request":{"href":"https://api.github.com/repos/alibaba/rax/pulls/835"}},"in_reply_to_id":244122797},"pull_request":{"url":"https://api.github.com/repos/alibaba/rax/pulls/835","id":241110049,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMTEwMDQ5","html_url":"https://github.com/alibaba/rax/pull/835","diff_url":"https://github.com/alibaba/rax/pull/835.diff","patch_url":"https://github.com/alibaba/rax/pull/835.patch","issue_url":"https://api.github.com/repos/alibaba/rax/issues/835","number":835,"state":"open","locked":false,"title":"[WIP] miniapp-webpack-plugin","user":{"login":"chenjun1011","id":1303018,"node_id":"MDQ6VXNlcjEzMDMwMTg=","avatar_url":"https://avatars3.githubusercontent.com/u/1303018?v=4","gravatar_id":"","url":"https://api.github.com/users/chenjun1011","html_url":"https://github.com/chenjun1011","followers_url":"https://api.github.com/users/chenjun1011/followers","following_url":"https://api.github.com/users/chenjun1011/following{/other_user}","gists_url":"https://api.github.com/users/chenjun1011/gists{/gist_id}","starred_url":"https://api.github.com/users/chenjun1011/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenjun1011/subscriptions","organizations_url":"https://api.github.com/users/chenjun1011/orgs","repos_url":"https://api.github.com/users/chenjun1011/repos","events_url":"https://api.github.com/users/chenjun1011/events{/privacy}","received_events_url":"https://api.github.com/users/chenjun1011/received_events","type":"User","site_admin":false},"body":"* 拆分 miniapp builder 中的通用构建逻辑为 webpack 插件，包括\r\n   * WebpackExternalApiPlugin：  H5 下 api 扩展\r\n   * WebpackHtmlPlugin： 基于 framework 生成 html 模板\r\n   * WebpackAssetsPlugin： assets 合并逻辑\r\n* rax-scripts 增加 mp 的构建配置（当前用于支持 H5 下的开发构建）\r\n","created_at":"2018-12-27T09:17:38Z","updated_at":"2019-01-03T03:54:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23808d0efb520d25fa59c8644d5b3d52cb43d184","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alibaba/rax/pulls/835/commits","review_comments_url":"https://api.github.com/repos/alibaba/rax/pulls/835/comments","review_comment_url":"https://api.github.com/repos/alibaba/rax/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alibaba/rax/issues/835/comments","statuses_url":"https://api.github.com/repos/alibaba/rax/statuses/aa50cd38c07eadc9fa4f4c39a284c3a0a9573da2","head":{"label":"alibaba:mimiapp-webpack-plugin","ref":"mimiapp-webpack-plugin","sha":"aa50cd38c07eadc9fa4f4c39a284c3a0a9573da2","user":{"login":"alibaba","id":1961952,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NjE5NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1961952?v=4","gravatar_id":"","url":"https://api.github.com/users/alibaba","html_url":"https://github.com/alibaba","followers_url":"https://api.github.com/users/alibaba/followers","following_url":"https://api.github.com/users/alibaba/following{/other_user}","gists_url":"https://api.github.com/users/alibaba/gists{/gist_id}","starred_url":"https://api.github.com/users/alibaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibaba/subscriptions","organizations_url":"https://api.github.com/users/alibaba/orgs","repos_url":"https://api.github.com/users/alibaba/repos","events_url":"https://api.github.com/users/alibaba/events{/privacy}","received_events_url":"https://api.github.com/users/alibaba/received_events","type":"Organization","site_admin":false},"repo":{"id":70887222,"node_id":"MDEwOlJlcG9zaXRvcnk3MDg4NzIyMg==","name":"rax","full_name":"alibaba/rax","private":false,"owner":{"login":"alibaba","id":1961952,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NjE5NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1961952?v=4","gravatar_id":"","url":"https://api.github.com/users/alibaba","html_url":"https://github.com/alibaba","followers_url":"https://api.github.com/users/alibaba/followers","following_url":"https://api.github.com/users/alibaba/following{/other_user}","gists_url":"https://api.github.com/users/alibaba/gists{/gist_id}","starred_url":"https://api.github.com/users/alibaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibaba/subscriptions","organizations_url":"https://api.github.com/users/alibaba/orgs","repos_url":"https://api.github.com/users/alibaba/repos","events_url":"https://api.github.com/users/alibaba/events{/privacy}","received_events_url":"https://api.github.com/users/alibaba/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/alibaba/rax","description":"[ 🚧Work In Progress v1.0] The fastest way to build cross-container application.","fork":false,"url":"https://api.github.com/repos/alibaba/rax","forks_url":"https://api.github.com/repos/alibaba/rax/forks","keys_url":"https://api.github.com/repos/alibaba/rax/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alibaba/rax/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alibaba/rax/teams","hooks_url":"https://api.github.com/repos/alibaba/rax/hooks","issue_events_url":"https://api.github.com/repos/alibaba/rax/issues/events{/number}","events_url":"https://api.github.com/repos/alibaba/rax/events","assignees_url":"https://api.github.com/repos/alibaba/rax/assignees{/user}","branches_url":"https://api.github.com/repos/alibaba/rax/branches{/branch}","tags_url":"https://api.github.com/repos/alibaba/rax/tags","blobs_url":"https://api.github.com/repos/alibaba/rax/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alibaba/rax/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alibaba/rax/git/refs{/sha}","trees_url":"https://api.github.com/repos/alibaba/rax/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alibaba/rax/statuses/{sha}","languages_url":"https://api.github.com/repos/alibaba/rax/languages","stargazers_url":"https://api.github.com/repos/alibaba/rax/stargazers","contributors_url":"https://api.github.com/repos/alibaba/rax/contributors","subscribers_url":"https://api.github.com/repos/alibaba/rax/subscribers","subscription_url":"https://api.github.com/repos/alibaba/rax/subscription","commits_url":"https://api.github.com/repos/alibaba/rax/commits{/sha}","git_commits_url":"https://api.github.com/repos/alibaba/rax/git/commits{/sha}","comments_url":"https://api.github.com/repos/alibaba/rax/comments{/number}","issue_comment_url":"https://api.github.com/repos/alibaba/rax/issues/comments{/number}","contents_url":"https://api.github.com/repos/alibaba/rax/contents/{+path}","compare_url":"https://api.github.com/repos/alibaba/rax/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alibaba/rax/merges","archive_url":"https://api.github.com/repos/alibaba/rax/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alibaba/rax/downloads","issues_url":"https://api.github.com/repos/alibaba/rax/issues{/number}","pulls_url":"https://api.github.com/repos/alibaba/rax/pulls{/number}","milestones_url":"https://api.github.com/repos/alibaba/rax/milestones{/number}","notifications_url":"https://api.github.com/repos/alibaba/rax/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alibaba/rax/labels{/name}","releases_url":"https://api.github.com/repos/alibaba/rax/releases{/id}","deployments_url":"https://api.github.com/repos/alibaba/rax/deployments","created_at":"2016-10-14T07:53:50Z","updated_at":"2019-01-02T20:24:54Z","pushed_at":"2019-01-02T14:43:39Z","git_url":"git://github.com/alibaba/rax.git","ssh_url":"git@github.com:alibaba/rax.git","clone_url":"https://github.com/alibaba/rax.git","svn_url":"https://github.com/alibaba/rax","homepage":"https://developers.taobao.com/","size":9262,"stargazers_count":4863,"watchers_count":4863,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":416,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":416,"open_issues":33,"watchers":4863,"default_branch":"master"}},"base":{"label":"alibaba:master","ref":"master","sha":"53b08b53ee3bad93938dfdf2b3bfc587193e86fb","user":{"login":"alibaba","id":1961952,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NjE5NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1961952?v=4","gravatar_id":"","url":"https://api.github.com/users/alibaba","html_url":"https://github.com/alibaba","followers_url":"https://api.github.com/users/alibaba/followers","following_url":"https://api.github.com/users/alibaba/following{/other_user}","gists_url":"https://api.github.com/users/alibaba/gists{/gist_id}","starred_url":"https://api.github.com/users/alibaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibaba/subscriptions","organizations_url":"https://api.github.com/users/alibaba/orgs","repos_url":"https://api.github.com/users/alibaba/repos","events_url":"https://api.github.com/users/alibaba/events{/privacy}","received_events_url":"https://api.github.com/users/alibaba/received_events","type":"Organization","site_admin":false},"repo":{"id":70887222,"node_id":"MDEwOlJlcG9zaXRvcnk3MDg4NzIyMg==","name":"rax","full_name":"alibaba/rax","private":false,"owner":{"login":"alibaba","id":1961952,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NjE5NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1961952?v=4","gravatar_id":"","url":"https://api.github.com/users/alibaba","html_url":"https://github.com/alibaba","followers_url":"https://api.github.com/users/alibaba/followers","following_url":"https://api.github.com/users/alibaba/following{/other_user}","gists_url":"https://api.github.com/users/alibaba/gists{/gist_id}","starred_url":"https://api.github.com/users/alibaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibaba/subscriptions","organizations_url":"https://api.github.com/users/alibaba/orgs","repos_url":"https://api.github.com/users/alibaba/repos","events_url":"https://api.github.com/users/alibaba/events{/privacy}","received_events_url":"https://api.github.com/users/alibaba/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/alibaba/rax","description":"[ 🚧Work In Progress v1.0] The fastest way to build cross-container application.","fork":false,"url":"https://api.github.com/repos/alibaba/rax","forks_url":"https://api.github.com/repos/alibaba/rax/forks","keys_url":"https://api.github.com/repos/alibaba/rax/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alibaba/rax/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alibaba/rax/teams","hooks_url":"https://api.github.com/repos/alibaba/rax/hooks","issue_events_url":"https://api.github.com/repos/alibaba/rax/issues/events{/number}","events_url":"https://api.github.com/repos/alibaba/rax/events","assignees_url":"https://api.github.com/repos/alibaba/rax/assignees{/user}","branches_url":"https://api.github.com/repos/alibaba/rax/branches{/branch}","tags_url":"https://api.github.com/repos/alibaba/rax/tags","blobs_url":"https://api.github.com/repos/alibaba/rax/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alibaba/rax/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alibaba/rax/git/refs{/sha}","trees_url":"https://api.github.com/repos/alibaba/rax/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alibaba/rax/statuses/{sha}","languages_url":"https://api.github.com/repos/alibaba/rax/languages","stargazers_url":"https://api.github.com/repos/alibaba/rax/stargazers","contributors_url":"https://api.github.com/repos/alibaba/rax/contributors","subscribers_url":"https://api.github.com/repos/alibaba/rax/subscribers","subscription_url":"https://api.github.com/repos/alibaba/rax/subscription","commits_url":"https://api.github.com/repos/alibaba/rax/commits{/sha}","git_commits_url":"https://api.github.com/repos/alibaba/rax/git/commits{/sha}","comments_url":"https://api.github.com/repos/alibaba/rax/comments{/number}","issue_comment_url":"https://api.github.com/repos/alibaba/rax/issues/comments{/number}","contents_url":"https://api.github.com/repos/alibaba/rax/contents/{+path}","compare_url":"https://api.github.com/repos/alibaba/rax/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alibaba/rax/merges","archive_url":"https://api.github.com/repos/alibaba/rax/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alibaba/rax/downloads","issues_url":"https://api.github.com/repos/alibaba/rax/issues{/number}","pulls_url":"https://api.github.com/repos/alibaba/rax/pulls{/number}","milestones_url":"https://api.github.com/repos/alibaba/rax/milestones{/number}","notifications_url":"https://api.github.com/repos/alibaba/rax/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alibaba/rax/labels{/name}","releases_url":"https://api.github.com/repos/alibaba/rax/releases{/id}","deployments_url":"https://api.github.com/repos/alibaba/rax/deployments","created_at":"2016-10-14T07:53:50Z","updated_at":"2019-01-02T20:24:54Z","pushed_at":"2019-01-02T14:43:39Z","git_url":"git://github.com/alibaba/rax.git","ssh_url":"git@github.com:alibaba/rax.git","clone_url":"https://github.com/alibaba/rax.git","svn_url":"https://github.com/alibaba/rax","homepage":"https://developers.taobao.com/","size":9262,"stargazers_count":4863,"watchers_count":4863,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":416,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":416,"open_issues":33,"watchers":4863,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alibaba/rax/pulls/835"},"html":{"href":"https://github.com/alibaba/rax/pull/835"},"issue":{"href":"https://api.github.com/repos/alibaba/rax/issues/835"},"comments":{"href":"https://api.github.com/repos/alibaba/rax/issues/835/comments"},"review_comments":{"href":"https://api.github.com/repos/alibaba/rax/pulls/835/comments"},"review_comment":{"href":"https://api.github.com/repos/alibaba/rax/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alibaba/rax/pulls/835/commits"},"statuses":{"href":"https://api.github.com/repos/alibaba/rax/statuses/aa50cd38c07eadc9fa4f4c39a284c3a0a9573da2"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"yuanyan"}}