{"action":"created","comment":{"url":"https://api.github.com/repos/andywer/webpack-blocks/pulls/comments/104004498","pull_request_review_id":24816279,"id":104004498,"diff_hunk":"@@ -19,26 +19,28 @@ function extractText (outputFilePattern, fileType) {\n \n   const plugin = new ExtractTextPlugin(outputFilePattern)\n \n-  return (context, webpackConfig) => {\n-    const loaderConfig = getLoaderConfigByType(context, webpackConfig, fileType)\n+  return (context, util) => prevConfig => {\n+    const loaderConfig = getLoaderConfigByType(context, prevConfig, fileType)\n     const nonStyleLoaders = getNonStyleLoaders(loaderConfig, fileType)\n \n-    return {\n-      module: {\n-        loaders: [\n-          {\n-            test: context.fileType(fileType),\n-            exclude: loaderConfig.exclude,\n-            loader: plugin.extract({\n-              fallbackLoader: 'style-loader',\n-              loader: nonStyleLoaders\n-            }),\n-            loaders: undefined\n-          }\n-        ]\n-      },\n-      plugins: [ plugin ]\n-    }\n+    // Partial application of `addLoader`, `addPlugin` & `removeLoaders`\n+    // Bind them to their job, but don't apply them on a config yet\n+\n+    const _addLoader = util.addLoader({\n+      test: context.fileType(fileType),\n+      exclude: loaderConfig.exclude,\n+      loader: plugin.extract({\n+        fallbackLoader: 'style-loader',\n+        loader: nonStyleLoaders\n+      })\n+    })\n+    const _addPlugin = util.addPlugin(plugin)\n+    const _removeLoaders = removeLoaders(context.fileType(fileType))\n+\n+    // Now apply them to the config: Remove the existing loaders for that\n+    // file type, add the new loader and add the plugin\n+\n+    return _addPlugin(_addLoader(_removeLoaders(prevConfig)))","path":"packages/extract-text/index.js","position":43,"original_position":43,"commit_id":"5574f2504cadef0cf8eca98455d1ea8a84016479","original_commit_id":"5574f2504cadef0cf8eca98455d1ea8a84016479","user":{"login":"andywer","id":1842462,"avatar_url":"https://avatars3.githubusercontent.com/u/1842462?v=3","gravatar_id":"","url":"https://api.github.com/users/andywer","html_url":"https://github.com/andywer","followers_url":"https://api.github.com/users/andywer/followers","following_url":"https://api.github.com/users/andywer/following{/other_user}","gists_url":"https://api.github.com/users/andywer/gists{/gist_id}","starred_url":"https://api.github.com/users/andywer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andywer/subscriptions","organizations_url":"https://api.github.com/users/andywer/orgs","repos_url":"https://api.github.com/users/andywer/repos","events_url":"https://api.github.com/users/andywer/events{/privacy}","received_events_url":"https://api.github.com/users/andywer/received_events","type":"User","site_admin":false},"body":"But it isn't a group of blocks, it's just three update functions... I already thought about `util.aggregate([ _removeLoaders, ... ])` or something like that, but I'm hesitating adding more new stuff to `util`.","created_at":"2017-03-02T19:11:08Z","updated_at":"2017-03-02T19:11:08Z","html_url":"https://github.com/andywer/webpack-blocks/pull/128#discussion_r104004498","pull_request_url":"https://api.github.com/repos/andywer/webpack-blocks/pulls/128","_links":{"self":{"href":"https://api.github.com/repos/andywer/webpack-blocks/pulls/comments/104004498"},"html":{"href":"https://github.com/andywer/webpack-blocks/pull/128#discussion_r104004498"},"pull_request":{"href":"https://api.github.com/repos/andywer/webpack-blocks/pulls/128"}}},"pull_request":{"url":"https://api.github.com/repos/andywer/webpack-blocks/pulls/128","id":108820323,"html_url":"https://github.com/andywer/webpack-blocks/pull/128","diff_url":"https://github.com/andywer/webpack-blocks/pull/128.diff","patch_url":"https://github.com/andywer/webpack-blocks/pull/128.patch","issue_url":"https://api.github.com/repos/andywer/webpack-blocks/issues/128","number":128,"state":"open","locked":false,"title":"New API","user":{"login":"andywer","id":1842462,"avatar_url":"https://avatars3.githubusercontent.com/u/1842462?v=3","gravatar_id":"","url":"https://api.github.com/users/andywer","html_url":"https://github.com/andywer","followers_url":"https://api.github.com/users/andywer/followers","following_url":"https://api.github.com/users/andywer/following{/other_user}","gists_url":"https://api.github.com/users/andywer/gists{/gist_id}","starred_url":"https://api.github.com/users/andywer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andywer/subscriptions","organizations_url":"https://api.github.com/users/andywer/orgs","repos_url":"https://api.github.com/users/andywer/repos","events_url":"https://api.github.com/users/andywer/events{/privacy}","received_events_url":"https://api.github.com/users/andywer/received_events","type":"User","site_admin":false},"body":"Introduces the new core API. Resolves #125.\r\n\r\nStill using `module.loaders` and webpack-merge's smart merge, though.\r\n\r\n@aaronjensen","created_at":"2017-03-02T18:21:17Z","updated_at":"2017-03-02T19:11:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3beea0cf8b78a5a608dfbc2047eb905fec300b2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/andywer/webpack-blocks/pulls/128/commits","review_comments_url":"https://api.github.com/repos/andywer/webpack-blocks/pulls/128/comments","review_comment_url":"https://api.github.com/repos/andywer/webpack-blocks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andywer/webpack-blocks/issues/128/comments","statuses_url":"https://api.github.com/repos/andywer/webpack-blocks/statuses/5574f2504cadef0cf8eca98455d1ea8a84016479","head":{"label":"andywer:feature/new-api","ref":"feature/new-api","sha":"5574f2504cadef0cf8eca98455d1ea8a84016479","user":{"login":"andywer","id":1842462,"avatar_url":"https://avatars3.githubusercontent.com/u/1842462?v=3","gravatar_id":"","url":"https://api.github.com/users/andywer","html_url":"https://github.com/andywer","followers_url":"https://api.github.com/users/andywer/followers","following_url":"https://api.github.com/users/andywer/following{/other_user}","gists_url":"https://api.github.com/users/andywer/gists{/gist_id}","starred_url":"https://api.github.com/users/andywer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andywer/subscriptions","organizations_url":"https://api.github.com/users/andywer/orgs","repos_url":"https://api.github.com/users/andywer/repos","events_url":"https://api.github.com/users/andywer/events{/privacy}","received_events_url":"https://api.github.com/users/andywer/received_events","type":"User","site_admin":false},"repo":{"id":69284431,"name":"webpack-blocks","full_name":"andywer/webpack-blocks","owner":{"login":"andywer","id":1842462,"avatar_url":"https://avatars3.githubusercontent.com/u/1842462?v=3","gravatar_id":"","url":"https://api.github.com/users/andywer","html_url":"https://github.com/andywer","followers_url":"https://api.github.com/users/andywer/followers","following_url":"https://api.github.com/users/andywer/following{/other_user}","gists_url":"https://api.github.com/users/andywer/gists{/gist_id}","starred_url":"https://api.github.com/users/andywer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andywer/subscriptions","organizations_url":"https://api.github.com/users/andywer/orgs","repos_url":"https://api.github.com/users/andywer/repos","events_url":"https://api.github.com/users/andywer/events{/privacy}","received_events_url":"https://api.github.com/users/andywer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andywer/webpack-blocks","description":"📦 Configure webpack using functional feature blocks.","fork":false,"url":"https://api.github.com/repos/andywer/webpack-blocks","forks_url":"https://api.github.com/repos/andywer/webpack-blocks/forks","keys_url":"https://api.github.com/repos/andywer/webpack-blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andywer/webpack-blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andywer/webpack-blocks/teams","hooks_url":"https://api.github.com/repos/andywer/webpack-blocks/hooks","issue_events_url":"https://api.github.com/repos/andywer/webpack-blocks/issues/events{/number}","events_url":"https://api.github.com/repos/andywer/webpack-blocks/events","assignees_url":"https://api.github.com/repos/andywer/webpack-blocks/assignees{/user}","branches_url":"https://api.github.com/repos/andywer/webpack-blocks/branches{/branch}","tags_url":"https://api.github.com/repos/andywer/webpack-blocks/tags","blobs_url":"https://api.github.com/repos/andywer/webpack-blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andywer/webpack-blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andywer/webpack-blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/andywer/webpack-blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andywer/webpack-blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/andywer/webpack-blocks/languages","stargazers_url":"https://api.github.com/repos/andywer/webpack-blocks/stargazers","contributors_url":"https://api.github.com/repos/andywer/webpack-blocks/contributors","subscribers_url":"https://api.github.com/repos/andywer/webpack-blocks/subscribers","subscription_url":"https://api.github.com/repos/andywer/webpack-blocks/subscription","commits_url":"https://api.github.com/repos/andywer/webpack-blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/andywer/webpack-blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/andywer/webpack-blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/andywer/webpack-blocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/andywer/webpack-blocks/contents/{+path}","compare_url":"https://api.github.com/repos/andywer/webpack-blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andywer/webpack-blocks/merges","archive_url":"https://api.github.com/repos/andywer/webpack-blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andywer/webpack-blocks/downloads","issues_url":"https://api.github.com/repos/andywer/webpack-blocks/issues{/number}","pulls_url":"https://api.github.com/repos/andywer/webpack-blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/andywer/webpack-blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/andywer/webpack-blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andywer/webpack-blocks/labels{/name}","releases_url":"https://api.github.com/repos/andywer/webpack-blocks/releases{/id}","deployments_url":"https://api.github.com/repos/andywer/webpack-blocks/deployments","created_at":"2016-09-26T19:18:30Z","updated_at":"2017-03-02T09:17:18Z","pushed_at":"2017-03-02T18:21:18Z","git_url":"git://github.com/andywer/webpack-blocks.git","ssh_url":"git@github.com:andywer/webpack-blocks.git","clone_url":"https://github.com/andywer/webpack-blocks.git","svn_url":"https://github.com/andywer/webpack-blocks","homepage":"","size":327,"stargazers_count":1933,"watchers_count":1933,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":21,"forks":52,"open_issues":21,"watchers":1933,"default_branch":"master"}},"base":{"label":"andywer:release/2.0","ref":"release/2.0","sha":"0e6c1d836c23c5f4fd1c05da7b145113a5af79ca","user":{"login":"andywer","id":1842462,"avatar_url":"https://avatars3.githubusercontent.com/u/1842462?v=3","gravatar_id":"","url":"https://api.github.com/users/andywer","html_url":"https://github.com/andywer","followers_url":"https://api.github.com/users/andywer/followers","following_url":"https://api.github.com/users/andywer/following{/other_user}","gists_url":"https://api.github.com/users/andywer/gists{/gist_id}","starred_url":"https://api.github.com/users/andywer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andywer/subscriptions","organizations_url":"https://api.github.com/users/andywer/orgs","repos_url":"https://api.github.com/users/andywer/repos","events_url":"https://api.github.com/users/andywer/events{/privacy}","received_events_url":"https://api.github.com/users/andywer/received_events","type":"User","site_admin":false},"repo":{"id":69284431,"name":"webpack-blocks","full_name":"andywer/webpack-blocks","owner":{"login":"andywer","id":1842462,"avatar_url":"https://avatars3.githubusercontent.com/u/1842462?v=3","gravatar_id":"","url":"https://api.github.com/users/andywer","html_url":"https://github.com/andywer","followers_url":"https://api.github.com/users/andywer/followers","following_url":"https://api.github.com/users/andywer/following{/other_user}","gists_url":"https://api.github.com/users/andywer/gists{/gist_id}","starred_url":"https://api.github.com/users/andywer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andywer/subscriptions","organizations_url":"https://api.github.com/users/andywer/orgs","repos_url":"https://api.github.com/users/andywer/repos","events_url":"https://api.github.com/users/andywer/events{/privacy}","received_events_url":"https://api.github.com/users/andywer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andywer/webpack-blocks","description":"📦 Configure webpack using functional feature blocks.","fork":false,"url":"https://api.github.com/repos/andywer/webpack-blocks","forks_url":"https://api.github.com/repos/andywer/webpack-blocks/forks","keys_url":"https://api.github.com/repos/andywer/webpack-blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andywer/webpack-blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andywer/webpack-blocks/teams","hooks_url":"https://api.github.com/repos/andywer/webpack-blocks/hooks","issue_events_url":"https://api.github.com/repos/andywer/webpack-blocks/issues/events{/number}","events_url":"https://api.github.com/repos/andywer/webpack-blocks/events","assignees_url":"https://api.github.com/repos/andywer/webpack-blocks/assignees{/user}","branches_url":"https://api.github.com/repos/andywer/webpack-blocks/branches{/branch}","tags_url":"https://api.github.com/repos/andywer/webpack-blocks/tags","blobs_url":"https://api.github.com/repos/andywer/webpack-blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andywer/webpack-blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andywer/webpack-blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/andywer/webpack-blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andywer/webpack-blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/andywer/webpack-blocks/languages","stargazers_url":"https://api.github.com/repos/andywer/webpack-blocks/stargazers","contributors_url":"https://api.github.com/repos/andywer/webpack-blocks/contributors","subscribers_url":"https://api.github.com/repos/andywer/webpack-blocks/subscribers","subscription_url":"https://api.github.com/repos/andywer/webpack-blocks/subscription","commits_url":"https://api.github.com/repos/andywer/webpack-blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/andywer/webpack-blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/andywer/webpack-blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/andywer/webpack-blocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/andywer/webpack-blocks/contents/{+path}","compare_url":"https://api.github.com/repos/andywer/webpack-blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andywer/webpack-blocks/merges","archive_url":"https://api.github.com/repos/andywer/webpack-blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andywer/webpack-blocks/downloads","issues_url":"https://api.github.com/repos/andywer/webpack-blocks/issues{/number}","pulls_url":"https://api.github.com/repos/andywer/webpack-blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/andywer/webpack-blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/andywer/webpack-blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andywer/webpack-blocks/labels{/name}","releases_url":"https://api.github.com/repos/andywer/webpack-blocks/releases{/id}","deployments_url":"https://api.github.com/repos/andywer/webpack-blocks/deployments","created_at":"2016-09-26T19:18:30Z","updated_at":"2017-03-02T09:17:18Z","pushed_at":"2017-03-02T18:21:18Z","git_url":"git://github.com/andywer/webpack-blocks.git","ssh_url":"git@github.com:andywer/webpack-blocks.git","clone_url":"https://github.com/andywer/webpack-blocks.git","svn_url":"https://github.com/andywer/webpack-blocks","homepage":"","size":327,"stargazers_count":1933,"watchers_count":1933,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":21,"forks":52,"open_issues":21,"watchers":1933,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andywer/webpack-blocks/pulls/128"},"html":{"href":"https://github.com/andywer/webpack-blocks/pull/128"},"issue":{"href":"https://api.github.com/repos/andywer/webpack-blocks/issues/128"},"comments":{"href":"https://api.github.com/repos/andywer/webpack-blocks/issues/128/comments"},"review_comments":{"href":"https://api.github.com/repos/andywer/webpack-blocks/pulls/128/comments"},"review_comment":{"href":"https://api.github.com/repos/andywer/webpack-blocks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andywer/webpack-blocks/pulls/128/commits"},"statuses":{"href":"https://api.github.com/repos/andywer/webpack-blocks/statuses/5574f2504cadef0cf8eca98455d1ea8a84016479"}}}}
{"actor":{"display_login":"andywer"}}