{"action":"created","comment":{"url":"https://api.github.com/repos/webpack/webpack/pulls/comments/175687119","pull_request_review_id":105254068,"id":175687119,"diff_hunk":"@@ -155,27 +181,31 @@ class DefinePlugin {\n \t\t\t\t\t\t\t);\n \t\t\t\t\t\tparser.hooks.evaluateTypeof\n \t\t\t\t\t\t\t.for(key)\n-\t\t\t\t\t\t\t.tap(\"DefinePlugin\", ParserHelpers.evaluateToString(\"object\"));\n+\t\t\t\t\t\t\t.tap(\"DefinePlugin\", expr => {\n+\t\t\t\t\t\t\t\treturn ParserHelpers.evaluateToString(\"object\");\n+\t\t\t\t\t\t\t});\n \t\t\t\t\t\tparser.hooks.expression\n \t\t\t\t\t\t\t.for(key)\n-\t\t\t\t\t\t\t.tap(\n-\t\t\t\t\t\t\t\t\"DefinePlugin\",\n-\t\t\t\t\t\t\t\t/__webpack_require__/.test(code)\n-\t\t\t\t\t\t\t\t\t? ParserHelpers.toConstantDependencyWithWebpackRequire(\n-\t\t\t\t\t\t\t\t\t\t\tparser,\n-\t\t\t\t\t\t\t\t\t\t\tcode\n-\t\t\t\t\t\t\t\t\t\t)\n-\t\t\t\t\t\t\t\t\t: ParserHelpers.toConstantDependency(parser, code)\n-\t\t\t\t\t\t\t);\n+\t\t\t\t\t\t\t.tap(\"DefinePlugin\", expr => {\n+\t\t\t\t\t\t\t\tregisterFileDependencies(code);","path":"lib/DefinePlugin.js","position":135,"original_position":135,"commit_id":"861e079b78fab34917a7e2bd221c885f1e07b1b2","original_commit_id":"861e079b78fab34917a7e2bd221c885f1e07b1b2","user":{"login":"sokra","id":1365881,"avatar_url":"https://avatars0.githubusercontent.com/u/1365881?v=4","gravatar_id":"","url":"https://api.github.com/users/sokra","html_url":"https://github.com/sokra","followers_url":"https://api.github.com/users/sokra/followers","following_url":"https://api.github.com/users/sokra/following{/other_user}","gists_url":"https://api.github.com/users/sokra/gists{/gist_id}","starred_url":"https://api.github.com/users/sokra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sokra/subscriptions","organizations_url":"https://api.github.com/users/sokra/orgs","repos_url":"https://api.github.com/users/sokra/repos","events_url":"https://api.github.com/users/sokra/events{/privacy}","received_events_url":"https://api.github.com/users/sokra/received_events","type":"User","site_admin":false},"body":"Move the `const code = stringifyObj(obj)` into this hook too.","created_at":"2018-03-20T08:43:04Z","updated_at":"2018-03-20T08:43:52Z","html_url":"https://github.com/webpack/webpack/pull/6793#discussion_r175687119","pull_request_url":"https://api.github.com/repos/webpack/webpack/pulls/6793","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/webpack/webpack/pulls/comments/175687119"},"html":{"href":"https://github.com/webpack/webpack/pull/6793#discussion_r175687119"},"pull_request":{"href":"https://api.github.com/repos/webpack/webpack/pulls/6793"}}},"pull_request":{"url":"https://api.github.com/repos/webpack/webpack/pulls/6793","id":175797119,"html_url":"https://github.com/webpack/webpack/pull/6793","diff_url":"https://github.com/webpack/webpack/pull/6793.diff","patch_url":"https://github.com/webpack/webpack/pull/6793.patch","issue_url":"https://api.github.com/repos/webpack/webpack/issues/6793","number":6793,"state":"open","locked":false,"title":"[WIP] DefinePlugin: add ability to use function return values","user":{"login":"ronkorving","id":631240,"avatar_url":"https://avatars0.githubusercontent.com/u/631240?v=4","gravatar_id":"","url":"https://api.github.com/users/ronkorving","html_url":"https://github.com/ronkorving","followers_url":"https://api.github.com/users/ronkorving/followers","following_url":"https://api.github.com/users/ronkorving/following{/other_user}","gists_url":"https://api.github.com/users/ronkorving/gists{/gist_id}","starred_url":"https://api.github.com/users/ronkorving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronkorving/subscriptions","organizations_url":"https://api.github.com/users/ronkorving/orgs","repos_url":"https://api.github.com/users/ronkorving/repos","events_url":"https://api.github.com/users/ronkorving/events{/privacy}","received_events_url":"https://api.github.com/users/ronkorving/received_events","type":"User","site_admin":false},"body":"**What kind of change does this PR introduce?**\r\n\r\nThis adds the following API to DefinePlugin:\r\n\r\n```js\r\nnew webpack.DefinePlugin({\r\n  BUILT_AT: webpack.DefinePlugin.runtimeValue(Date.now, [fileDep, fileDep])\r\n})\r\n```\r\n\r\n**Did you add tests for your changes?**\r\n\r\nYes\r\n\r\n**If relevant, link to documentation update:**\r\n\r\n<!-- Link PR from webpack/webpack.js.org here, or N/A -->\r\nNot yet\r\n\r\n**Summary**\r\n\r\nI wanted to inject an RPC schema into my builds, and when that schema changes, I want webpack-dev-server to rebuild and pick up the updated schema.\r\n\r\nSee #6749\r\n\r\n**Does this PR introduce a breaking change?**\r\n\r\nNo\r\n\r\n**Other information**\r\n\r\nThis PR is not ready to be merged (see comments inside), but I was hoping for some initial feedback.","created_at":"2018-03-19T03:27:52Z","updated_at":"2018-03-20T08:43:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c91a28c6fc0ebbc593c07d24e2b78f19a23dade","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":572709861,"url":"https://api.github.com/repos/webpack/webpack/labels/PR:%20CI-not-ok","name":"PR: CI-not-ok","color":"d93f0b","default":false},{"id":572817412,"url":"https://api.github.com/repos/webpack/webpack/labels/PR:%20review-outdated","name":"PR: review-outdated","color":"d93f0b","default":false},{"id":572838417,"url":"https://api.github.com/repos/webpack/webpack/labels/PR:%20tests-needed","name":"PR: tests-needed","color":"d93f0b","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/webpack/webpack/pulls/6793/commits","review_comments_url":"https://api.github.com/repos/webpack/webpack/pulls/6793/comments","review_comment_url":"https://api.github.com/repos/webpack/webpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/6793/comments","statuses_url":"https://api.github.com/repos/webpack/webpack/statuses/861e079b78fab34917a7e2bd221c885f1e07b1b2","head":{"label":"ronkorving:define-functions","ref":"define-functions","sha":"861e079b78fab34917a7e2bd221c885f1e07b1b2","user":{"login":"ronkorving","id":631240,"avatar_url":"https://avatars0.githubusercontent.com/u/631240?v=4","gravatar_id":"","url":"https://api.github.com/users/ronkorving","html_url":"https://github.com/ronkorving","followers_url":"https://api.github.com/users/ronkorving/followers","following_url":"https://api.github.com/users/ronkorving/following{/other_user}","gists_url":"https://api.github.com/users/ronkorving/gists{/gist_id}","starred_url":"https://api.github.com/users/ronkorving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronkorving/subscriptions","organizations_url":"https://api.github.com/users/ronkorving/orgs","repos_url":"https://api.github.com/users/ronkorving/repos","events_url":"https://api.github.com/users/ronkorving/events{/privacy}","received_events_url":"https://api.github.com/users/ronkorving/received_events","type":"User","site_admin":false},"repo":{"id":125192515,"name":"webpack","full_name":"ronkorving/webpack","owner":{"login":"ronkorving","id":631240,"avatar_url":"https://avatars0.githubusercontent.com/u/631240?v=4","gravatar_id":"","url":"https://api.github.com/users/ronkorving","html_url":"https://github.com/ronkorving","followers_url":"https://api.github.com/users/ronkorving/followers","following_url":"https://api.github.com/users/ronkorving/following{/other_user}","gists_url":"https://api.github.com/users/ronkorving/gists{/gist_id}","starred_url":"https://api.github.com/users/ronkorving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronkorving/subscriptions","organizations_url":"https://api.github.com/users/ronkorving/orgs","repos_url":"https://api.github.com/users/ronkorving/repos","events_url":"https://api.github.com/users/ronkorving/events{/privacy}","received_events_url":"https://api.github.com/users/ronkorving/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ronkorving/webpack","description":"A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through \"loaders,\" modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.","fork":true,"url":"https://api.github.com/repos/ronkorving/webpack","forks_url":"https://api.github.com/repos/ronkorving/webpack/forks","keys_url":"https://api.github.com/repos/ronkorving/webpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ronkorving/webpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ronkorving/webpack/teams","hooks_url":"https://api.github.com/repos/ronkorving/webpack/hooks","issue_events_url":"https://api.github.com/repos/ronkorving/webpack/issues/events{/number}","events_url":"https://api.github.com/repos/ronkorving/webpack/events","assignees_url":"https://api.github.com/repos/ronkorving/webpack/assignees{/user}","branches_url":"https://api.github.com/repos/ronkorving/webpack/branches{/branch}","tags_url":"https://api.github.com/repos/ronkorving/webpack/tags","blobs_url":"https://api.github.com/repos/ronkorving/webpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ronkorving/webpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ronkorving/webpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/ronkorving/webpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ronkorving/webpack/statuses/{sha}","languages_url":"https://api.github.com/repos/ronkorving/webpack/languages","stargazers_url":"https://api.github.com/repos/ronkorving/webpack/stargazers","contributors_url":"https://api.github.com/repos/ronkorving/webpack/contributors","subscribers_url":"https://api.github.com/repos/ronkorving/webpack/subscribers","subscription_url":"https://api.github.com/repos/ronkorving/webpack/subscription","commits_url":"https://api.github.com/repos/ronkorving/webpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/ronkorving/webpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/ronkorving/webpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/ronkorving/webpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/ronkorving/webpack/contents/{+path}","compare_url":"https://api.github.com/repos/ronkorving/webpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ronkorving/webpack/merges","archive_url":"https://api.github.com/repos/ronkorving/webpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ronkorving/webpack/downloads","issues_url":"https://api.github.com/repos/ronkorving/webpack/issues{/number}","pulls_url":"https://api.github.com/repos/ronkorving/webpack/pulls{/number}","milestones_url":"https://api.github.com/repos/ronkorving/webpack/milestones{/number}","notifications_url":"https://api.github.com/repos/ronkorving/webpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ronkorving/webpack/labels{/name}","releases_url":"https://api.github.com/repos/ronkorving/webpack/releases{/id}","deployments_url":"https://api.github.com/repos/ronkorving/webpack/deployments","created_at":"2018-03-14T10:04:12Z","updated_at":"2018-03-14T10:04:20Z","pushed_at":"2018-03-20T02:02:22Z","git_url":"git://github.com/ronkorving/webpack.git","ssh_url":"git@github.com:ronkorving/webpack.git","clone_url":"https://github.com/ronkorving/webpack.git","svn_url":"https://github.com/ronkorving/webpack","homepage":"https://webpack.js.org","size":12591,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"webpack:master","ref":"master","sha":"4428efe48e1c5ff4cadb79e13f0fa48c12bdac35","user":{"login":"webpack","id":2105791,"avatar_url":"https://avatars2.githubusercontent.com/u/2105791?v=4","gravatar_id":"","url":"https://api.github.com/users/webpack","html_url":"https://github.com/webpack","followers_url":"https://api.github.com/users/webpack/followers","following_url":"https://api.github.com/users/webpack/following{/other_user}","gists_url":"https://api.github.com/users/webpack/gists{/gist_id}","starred_url":"https://api.github.com/users/webpack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webpack/subscriptions","organizations_url":"https://api.github.com/users/webpack/orgs","repos_url":"https://api.github.com/users/webpack/repos","events_url":"https://api.github.com/users/webpack/events{/privacy}","received_events_url":"https://api.github.com/users/webpack/received_events","type":"Organization","site_admin":false},"repo":{"id":3678731,"name":"webpack","full_name":"webpack/webpack","owner":{"login":"webpack","id":2105791,"avatar_url":"https://avatars2.githubusercontent.com/u/2105791?v=4","gravatar_id":"","url":"https://api.github.com/users/webpack","html_url":"https://github.com/webpack","followers_url":"https://api.github.com/users/webpack/followers","following_url":"https://api.github.com/users/webpack/following{/other_user}","gists_url":"https://api.github.com/users/webpack/gists{/gist_id}","starred_url":"https://api.github.com/users/webpack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webpack/subscriptions","organizations_url":"https://api.github.com/users/webpack/orgs","repos_url":"https://api.github.com/users/webpack/repos","events_url":"https://api.github.com/users/webpack/events{/privacy}","received_events_url":"https://api.github.com/users/webpack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/webpack/webpack","description":"A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through \"loaders,\" modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.","fork":false,"url":"https://api.github.com/repos/webpack/webpack","forks_url":"https://api.github.com/repos/webpack/webpack/forks","keys_url":"https://api.github.com/repos/webpack/webpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webpack/webpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webpack/webpack/teams","hooks_url":"https://api.github.com/repos/webpack/webpack/hooks","issue_events_url":"https://api.github.com/repos/webpack/webpack/issues/events{/number}","events_url":"https://api.github.com/repos/webpack/webpack/events","assignees_url":"https://api.github.com/repos/webpack/webpack/assignees{/user}","branches_url":"https://api.github.com/repos/webpack/webpack/branches{/branch}","tags_url":"https://api.github.com/repos/webpack/webpack/tags","blobs_url":"https://api.github.com/repos/webpack/webpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webpack/webpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webpack/webpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/webpack/webpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webpack/webpack/statuses/{sha}","languages_url":"https://api.github.com/repos/webpack/webpack/languages","stargazers_url":"https://api.github.com/repos/webpack/webpack/stargazers","contributors_url":"https://api.github.com/repos/webpack/webpack/contributors","subscribers_url":"https://api.github.com/repos/webpack/webpack/subscribers","subscription_url":"https://api.github.com/repos/webpack/webpack/subscription","commits_url":"https://api.github.com/repos/webpack/webpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/webpack/webpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/webpack/webpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/webpack/webpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/webpack/webpack/contents/{+path}","compare_url":"https://api.github.com/repos/webpack/webpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webpack/webpack/merges","archive_url":"https://api.github.com/repos/webpack/webpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webpack/webpack/downloads","issues_url":"https://api.github.com/repos/webpack/webpack/issues{/number}","pulls_url":"https://api.github.com/repos/webpack/webpack/pulls{/number}","milestones_url":"https://api.github.com/repos/webpack/webpack/milestones{/number}","notifications_url":"https://api.github.com/repos/webpack/webpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webpack/webpack/labels{/name}","releases_url":"https://api.github.com/repos/webpack/webpack/releases{/id}","deployments_url":"https://api.github.com/repos/webpack/webpack/deployments","created_at":"2012-03-10T10:08:14Z","updated_at":"2018-03-20T08:37:03Z","pushed_at":"2018-03-20T08:36:50Z","git_url":"git://github.com/webpack/webpack.git","ssh_url":"git@github.com:webpack/webpack.git","clone_url":"https://github.com/webpack/webpack.git","svn_url":"https://github.com/webpack/webpack","homepage":"https://webpack.js.org","size":12622,"stargazers_count":38851,"watchers_count":38851,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4842,"mirror_url":null,"archived":false,"open_issues_count":498,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":4842,"open_issues":498,"watchers":38851,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/webpack/webpack/pulls/6793"},"html":{"href":"https://github.com/webpack/webpack/pull/6793"},"issue":{"href":"https://api.github.com/repos/webpack/webpack/issues/6793"},"comments":{"href":"https://api.github.com/repos/webpack/webpack/issues/6793/comments"},"review_comments":{"href":"https://api.github.com/repos/webpack/webpack/pulls/6793/comments"},"review_comment":{"href":"https://api.github.com/repos/webpack/webpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/webpack/webpack/pulls/6793/commits"},"statuses":{"href":"https://api.github.com/repos/webpack/webpack/statuses/861e079b78fab34917a7e2bd221c885f1e07b1b2"}},"author_association":"NONE"}}
{"actor":{"display_login":"sokra"}}