{"action":"created","comment":{"url":"https://api.github.com/repos/webpack/webpack-cli/pulls/comments/194291316","pull_request_review_id":127433419,"id":194291316,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDI5MTMxNg==","diff_hunk":"@@ -11,6 +11,13 @@ const modifyHelper = require(\"@webpack-cli/utils/modify-config-helper\");\n  *\n  */\n \n-module.exports = function add() {\n-\treturn modifyHelper(\"add\", defaultGenerator);\n+module.exports = function add(...args) {\n+\tconst DEFAULT_WEBPACK_CONFIG_FILENAME = \"webpack.config.js\";\n+\n+\tconst filePaths = args.slice(3);","path":"packages/add/index.js","position":9,"original_position":9,"commit_id":"be7a3f796fbd25be620a36b1c988237db7729767","original_commit_id":"be7a3f796fbd25be620a36b1c988237db7729767","user":{"login":"dhruvdutt","id":5961873,"node_id":"MDQ6VXNlcjU5NjE4NzM=","avatar_url":"https://avatars0.githubusercontent.com/u/5961873?v=4","gravatar_id":"","url":"https://api.github.com/users/dhruvdutt","html_url":"https://github.com/dhruvdutt","followers_url":"https://api.github.com/users/dhruvdutt/followers","following_url":"https://api.github.com/users/dhruvdutt/following{/other_user}","gists_url":"https://api.github.com/users/dhruvdutt/gists{/gist_id}","starred_url":"https://api.github.com/users/dhruvdutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhruvdutt/subscriptions","organizations_url":"https://api.github.com/users/dhruvdutt/orgs","repos_url":"https://api.github.com/users/dhruvdutt/repos","events_url":"https://api.github.com/users/dhruvdutt/events{/privacy}","received_events_url":"https://api.github.com/users/dhruvdutt/received_events","type":"User","site_admin":false},"body":"Because first 3 args would be node path, webpack-cli path, add command.\r\n4th item in the array would be everything after add command like the custom config path/name. So, we're slicing first three items to get the config path.\r\n\r\nWe can't directly use the last element of `args` because that would be \"add\" if the user doesn't mention any arg after add.\r\n","created_at":"2018-06-11T04:41:01Z","updated_at":"2018-06-11T04:41:02Z","html_url":"https://github.com/webpack/webpack-cli/pull/501#discussion_r194291316","pull_request_url":"https://api.github.com/repos/webpack/webpack-cli/pulls/501","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/comments/194291316"},"html":{"href":"https://github.com/webpack/webpack-cli/pull/501#discussion_r194291316"},"pull_request":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/501"}},"in_reply_to_id":194276542},"pull_request":{"url":"https://api.github.com/repos/webpack/webpack-cli/pulls/501","id":193772977,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNzcyOTc3","html_url":"https://github.com/webpack/webpack-cli/pull/501","diff_url":"https://github.com/webpack/webpack-cli/pull/501.diff","patch_url":"https://github.com/webpack/webpack-cli/pull/501.patch","issue_url":"https://api.github.com/repos/webpack/webpack-cli/issues/501","number":501,"state":"open","locked":false,"title":"cli(add): support for webpack config file","user":{"login":"dhruvdutt","id":5961873,"node_id":"MDQ6VXNlcjU5NjE4NzM=","avatar_url":"https://avatars0.githubusercontent.com/u/5961873?v=4","gravatar_id":"","url":"https://api.github.com/users/dhruvdutt","html_url":"https://github.com/dhruvdutt","followers_url":"https://api.github.com/users/dhruvdutt/followers","following_url":"https://api.github.com/users/dhruvdutt/following{/other_user}","gists_url":"https://api.github.com/users/dhruvdutt/gists{/gist_id}","starred_url":"https://api.github.com/users/dhruvdutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhruvdutt/subscriptions","organizations_url":"https://api.github.com/users/dhruvdutt/orgs","repos_url":"https://api.github.com/users/dhruvdutt/repos","events_url":"https://api.github.com/users/dhruvdutt/events{/privacy}","received_events_url":"https://api.github.com/users/dhruvdutt/received_events","type":"User","site_admin":false},"body":"**What kind of change does this PR introduce?**\r\nFeature\r\n\r\n**Did you add tests for your changes?**\r\nNo\r\n\r\n**If relevant, did you update the documentation?**\r\nYes\r\n\r\n**Summary**\r\nAdd support to specify webpack config file with args, default to webpack.config.js\r\n\r\n- Specifying config file: `webpack-cli add webpack.dev.js`\r\n\r\n![image](https://user-images.githubusercontent.com/5961873/37558480-dd09313a-2a3a-11e8-9c99-22e1ab4424ce.png)\r\n\r\n- Default config file: `webpack-cli add`\r\n\r\n![image](https://user-images.githubusercontent.com/5961873/37558489-06cd2d50-2a3b-11e8-849d-4d49437083f1.png)\r\n\r\n- Non-existential file: `webpack-cli add aaahha.js`\r\n\r\n![image](https://user-images.githubusercontent.com/5961873/37558534-7563118a-2a3b-11e8-8cbb-d224f1a29605.png)\r\n\r\nSimilar usage for `update`, `remove`.\r\n\r\n**Does this PR introduce a breaking change?**\r\nNo\r\n\r\nFixes #279\r\n","created_at":"2018-06-09T11:29:33Z","updated_at":"2018-06-11T04:41:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1e4a0eb3db5f339fd0819dc693a135041c18216","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":796805034,"node_id":"MDU6TGFiZWw3OTY4MDUwMzQ=","url":"https://api.github.com/repos/webpack/webpack-cli/labels/PR:%20unreviewed","name":"PR: unreviewed","color":"afd8f7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/webpack/webpack-cli/pulls/501/commits","review_comments_url":"https://api.github.com/repos/webpack/webpack-cli/pulls/501/comments","review_comment_url":"https://api.github.com/repos/webpack/webpack-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/webpack/webpack-cli/issues/501/comments","statuses_url":"https://api.github.com/repos/webpack/webpack-cli/statuses/be7a3f796fbd25be620a36b1c988237db7729767","head":{"label":"dhruvdutt:add-config","ref":"add-config","sha":"be7a3f796fbd25be620a36b1c988237db7729767","user":{"login":"dhruvdutt","id":5961873,"node_id":"MDQ6VXNlcjU5NjE4NzM=","avatar_url":"https://avatars0.githubusercontent.com/u/5961873?v=4","gravatar_id":"","url":"https://api.github.com/users/dhruvdutt","html_url":"https://github.com/dhruvdutt","followers_url":"https://api.github.com/users/dhruvdutt/followers","following_url":"https://api.github.com/users/dhruvdutt/following{/other_user}","gists_url":"https://api.github.com/users/dhruvdutt/gists{/gist_id}","starred_url":"https://api.github.com/users/dhruvdutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhruvdutt/subscriptions","organizations_url":"https://api.github.com/users/dhruvdutt/orgs","repos_url":"https://api.github.com/users/dhruvdutt/repos","events_url":"https://api.github.com/users/dhruvdutt/events{/privacy}","received_events_url":"https://api.github.com/users/dhruvdutt/received_events","type":"User","site_admin":false},"repo":{"id":122456309,"node_id":"MDEwOlJlcG9zaXRvcnkxMjI0NTYzMDk=","name":"webpack-cli","full_name":"dhruvdutt/webpack-cli","owner":{"login":"dhruvdutt","id":5961873,"node_id":"MDQ6VXNlcjU5NjE4NzM=","avatar_url":"https://avatars0.githubusercontent.com/u/5961873?v=4","gravatar_id":"","url":"https://api.github.com/users/dhruvdutt","html_url":"https://github.com/dhruvdutt","followers_url":"https://api.github.com/users/dhruvdutt/followers","following_url":"https://api.github.com/users/dhruvdutt/following{/other_user}","gists_url":"https://api.github.com/users/dhruvdutt/gists{/gist_id}","starred_url":"https://api.github.com/users/dhruvdutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhruvdutt/subscriptions","organizations_url":"https://api.github.com/users/dhruvdutt/orgs","repos_url":"https://api.github.com/users/dhruvdutt/repos","events_url":"https://api.github.com/users/dhruvdutt/events{/privacy}","received_events_url":"https://api.github.com/users/dhruvdutt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dhruvdutt/webpack-cli","description":"Webpack's Command Line Interface","fork":true,"url":"https://api.github.com/repos/dhruvdutt/webpack-cli","forks_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/forks","keys_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/teams","hooks_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/hooks","issue_events_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/issues/events{/number}","events_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/events","assignees_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/assignees{/user}","branches_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/branches{/branch}","tags_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/tags","blobs_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/languages","stargazers_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/stargazers","contributors_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/contributors","subscribers_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/subscribers","subscription_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/subscription","commits_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/contents/{+path}","compare_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/merges","archive_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/downloads","issues_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/issues{/number}","pulls_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/labels{/name}","releases_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/releases{/id}","deployments_url":"https://api.github.com/repos/dhruvdutt/webpack-cli/deployments","created_at":"2018-02-22T09:21:59Z","updated_at":"2018-06-08T18:35:11Z","pushed_at":"2018-06-09T11:36:13Z","git_url":"git://github.com/dhruvdutt/webpack-cli.git","ssh_url":"git@github.com:dhruvdutt/webpack-cli.git","clone_url":"https://github.com/dhruvdutt/webpack-cli.git","svn_url":"https://github.com/dhruvdutt/webpack-cli","homepage":"https://webpack.js.org/api/cli/","size":4525,"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","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"webpack:master","ref":"master","sha":"945be4b100461b8227a79e15db08a78119004fc5","user":{"login":"webpack","id":2105791,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDU3OTE=","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":76603199,"node_id":"MDEwOlJlcG9zaXRvcnk3NjYwMzE5OQ==","name":"webpack-cli","full_name":"webpack/webpack-cli","owner":{"login":"webpack","id":2105791,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDU3OTE=","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-cli","description":"Webpack's Command Line Interface","fork":false,"url":"https://api.github.com/repos/webpack/webpack-cli","forks_url":"https://api.github.com/repos/webpack/webpack-cli/forks","keys_url":"https://api.github.com/repos/webpack/webpack-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webpack/webpack-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webpack/webpack-cli/teams","hooks_url":"https://api.github.com/repos/webpack/webpack-cli/hooks","issue_events_url":"https://api.github.com/repos/webpack/webpack-cli/issues/events{/number}","events_url":"https://api.github.com/repos/webpack/webpack-cli/events","assignees_url":"https://api.github.com/repos/webpack/webpack-cli/assignees{/user}","branches_url":"https://api.github.com/repos/webpack/webpack-cli/branches{/branch}","tags_url":"https://api.github.com/repos/webpack/webpack-cli/tags","blobs_url":"https://api.github.com/repos/webpack/webpack-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webpack/webpack-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webpack/webpack-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/webpack/webpack-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webpack/webpack-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/webpack/webpack-cli/languages","stargazers_url":"https://api.github.com/repos/webpack/webpack-cli/stargazers","contributors_url":"https://api.github.com/repos/webpack/webpack-cli/contributors","subscribers_url":"https://api.github.com/repos/webpack/webpack-cli/subscribers","subscription_url":"https://api.github.com/repos/webpack/webpack-cli/subscription","commits_url":"https://api.github.com/repos/webpack/webpack-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/webpack/webpack-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/webpack/webpack-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/webpack/webpack-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/webpack/webpack-cli/contents/{+path}","compare_url":"https://api.github.com/repos/webpack/webpack-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webpack/webpack-cli/merges","archive_url":"https://api.github.com/repos/webpack/webpack-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webpack/webpack-cli/downloads","issues_url":"https://api.github.com/repos/webpack/webpack-cli/issues{/number}","pulls_url":"https://api.github.com/repos/webpack/webpack-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/webpack/webpack-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/webpack/webpack-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webpack/webpack-cli/labels{/name}","releases_url":"https://api.github.com/repos/webpack/webpack-cli/releases{/id}","deployments_url":"https://api.github.com/repos/webpack/webpack-cli/deployments","created_at":"2016-12-15T23:05:08Z","updated_at":"2018-06-10T06:45:13Z","pushed_at":"2018-06-09T11:36:15Z","git_url":"git://github.com/webpack/webpack-cli.git","ssh_url":"git@github.com:webpack/webpack-cli.git","clone_url":"https://github.com/webpack/webpack-cli.git","svn_url":"https://github.com/webpack/webpack-cli","homepage":"https://webpack.js.org/api/cli/","size":4197,"stargazers_count":891,"watchers_count":891,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":135,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":135,"open_issues":21,"watchers":891,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/501"},"html":{"href":"https://github.com/webpack/webpack-cli/pull/501"},"issue":{"href":"https://api.github.com/repos/webpack/webpack-cli/issues/501"},"comments":{"href":"https://api.github.com/repos/webpack/webpack-cli/issues/501/comments"},"review_comments":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/501/comments"},"review_comment":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/webpack/webpack-cli/pulls/501/commits"},"statuses":{"href":"https://api.github.com/repos/webpack/webpack-cli/statuses/be7a3f796fbd25be620a36b1c988237db7729767"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"dhruvdutt"}}