{"action":"created","comment":{"url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/comments/148580975","pull_request_review_id":73846369,"id":148580975,"diff_hunk":"@@ -0,0 +1,162 @@\n+import fs from 'fs';\n+import _isArray from 'lodash/isArray';\n+import appRootDir from 'app-root-dir';\n+import path from 'path';\n+import webpack from 'webpack';\n+import ExtractCssChunks from 'extract-css-chunks-webpack-plugin';\n+import ExtractTextPlugin from 'extract-text-webpack-plugin';\n+import WriteFilePlugin from 'write-file-webpack-plugin'; // here so you can see what chunks are built\n+import config from '../';\n+import { removeNil } from '../../internal/utils/arrays';\n+import { ifElse } from '../../internal/utils/logic';\n+import { happyPackPlugin } from '../../internal/utils';\n+\n+\n+function externals() {\n+\n+  // UENO: Define externals\n+  // We don't want our node_modules to be bundled with any bundle that is\n+  // targetting the node environment, prefering them to be resolved via\n+  // native node module system.\n+\n+  // Some of our node_modules may contain files that depend on our\n+  // webpack loaders, e.g. CSS or SASS.\n+  // For these cases please make sure that the file extensions are\n+  // registered within the following configuration setting.\n+  const whitelist = [\n+    /\\.bin/,\n+    'source-map-support/register',\n+    'react-universal-component',\n+    'webpack-flush-chunks',\n+  ]\n+    // And any items that have been whitelisted in the config need\n+    // to be included in the bundling process too.\n+    .concat(config('nodeExternalsFileTypeWhitelist') || []);\n+\n+  return fs\n+    .readdirSync(path.resolve(appRootDir.get(), 'node_modules'))\n+    .filter(x => !whitelist.some((w) => {\n+      if (w instanceof RegExp) {\n+        return w.test(x);\n+      }\n+      return x === w;\n+    }))\n+    .reduce((ext, mod) => {\n+      // mark this module as external\n+      // https://webpack.js.org/configuration/externals\n+      ext[mod] = `commonjs ${mod}`;\n+      return ext;\n+    }, {});\n+}\n+\n+export default (webpackConfig, buildOptions) => {\n+  const { target, optimize = false, localIdentName } = buildOptions;\n+\n+  const isProd = optimize;\n+  const isDev = !isProd;\n+  const isClient = target === 'client';\n+  const isNode = !isClient;\n+\n+  const ifNode = ifElse(isNode);\n+  const ifClient = ifElse(isClient);\n+  const ifDevClient = ifElse(isDev && isClient);\n+\n+  // Overwrite the externals because apparently `webpack-node-externals` does not\n+  // work well with `webpack-flush-chunks`\n+  if (isNode) {\n+    webpackConfig.externals = externals();\n+  }\n+\n+  // Remove ExtractTextPlugin\n+  const etpIndex = webpackConfig.plugins.findIndex(p => p instanceof ExtractTextPlugin);\n+  if (etpIndex > -1) {\n+    webpackConfig.plugins.splice(etpIndex, 1);\n+  }\n+  // Add some plugins for css code splitting\n+  webpackConfig.plugins.push(\n+    ...removeNil([\n+      ifDevClient(new WriteFilePlugin()),\n+      ifClient(new ExtractCssChunks()),\n+      ifClient(\n+        new webpack.optimize.CommonsChunkPlugin({\n+          names: ['bootstrap'], // needed to put webpack bootstrap code before chunks\n+          filename: isDev ? '[name].js' : '[name]-[chunkhash].js',\n+          minChunks: Infinity,\n+        }),\n+      ),\n+      ifNode(\n+        new webpack.optimize.LimitChunkCountPlugin({\n+          maxChunks: 1,\n+        }),\n+      ),\n+    ],\n+  ));\n+\n+  // Overwrite happypack css dev plugin\n+  const happyPackDevclientCssIndex = webpackConfig.plugins.findIndex(r => r.id === 'happypack-devclient-css');\n+  if (happyPackDevclientCssIndex > 1) {\n+    webpackConfig.plugins.splice(\n+      happyPackDevclientCssIndex,\n+      1,\n+      happyPackPlugin({\n+        name: 'happypack-devclient-css',\n+        loaders: [\n+          'classnames-loader',\n+          ...ExtractCssChunks.extract({\n+            fallback: 'style-loader',\n+            use: [\n+              `css-loader?sourceMap=1&modules=1&importLoaders=1&localIdentName=${localIdentName}`,\n+              'postcss-loader?sourceMap=1',\n+              'sass-loader?sourceMap=1&outputStyle=expanded',\n+            ],\n+          }),\n+        ],\n+      }),\n+    );\n+  }","path":"config/extenders/codeSplitting.js","position":116,"original_position":116,"commit_id":"6d8844f1a76b53f77c8a09f3782231fc23717805","original_commit_id":"6d8844f1a76b53f77c8a09f3782231fc23717805","user":{"login":"baldurh","id":1823617,"avatar_url":"https://avatars1.githubusercontent.com/u/1823617?v=4","gravatar_id":"","url":"https://api.github.com/users/baldurh","html_url":"https://github.com/baldurh","followers_url":"https://api.github.com/users/baldurh/followers","following_url":"https://api.github.com/users/baldurh/following{/other_user}","gists_url":"https://api.github.com/users/baldurh/gists{/gist_id}","starred_url":"https://api.github.com/users/baldurh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baldurh/subscriptions","organizations_url":"https://api.github.com/users/baldurh/orgs","repos_url":"https://api.github.com/users/baldurh/repos","events_url":"https://api.github.com/users/baldurh/events{/privacy}","received_events_url":"https://api.github.com/users/baldurh/received_events","type":"User","site_admin":false},"body":"Maybe we don’t want to do css code splitting during dev?\r\nThen we don’t need this and don’t need `WriteFilePlugin`","created_at":"2017-11-02T16:08:46Z","updated_at":"2017-11-02T16:08:46Z","html_url":"https://github.com/ueno-llc/starter-kit-universally/pull/60#discussion_r148580975","pull_request_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/60","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/comments/148580975"},"html":{"href":"https://github.com/ueno-llc/starter-kit-universally/pull/60#discussion_r148580975"},"pull_request":{"href":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/60","id":145200073,"html_url":"https://github.com/ueno-llc/starter-kit-universally/pull/60","diff_url":"https://github.com/ueno-llc/starter-kit-universally/pull/60.diff","patch_url":"https://github.com/ueno-llc/starter-kit-universally/pull/60.patch","issue_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/issues/60","number":60,"state":"open","locked":false,"title":"Feature/css code splitting","user":{"login":"baldurh","id":1823617,"avatar_url":"https://avatars1.githubusercontent.com/u/1823617?v=4","gravatar_id":"","url":"https://api.github.com/users/baldurh","html_url":"https://github.com/baldurh","followers_url":"https://api.github.com/users/baldurh/followers","following_url":"https://api.github.com/users/baldurh/following{/other_user}","gists_url":"https://api.github.com/users/baldurh/gists{/gist_id}","starred_url":"https://api.github.com/users/baldurh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baldurh/subscriptions","organizations_url":"https://api.github.com/users/baldurh/orgs","repos_url":"https://api.github.com/users/baldurh/repos","events_url":"https://api.github.com/users/baldurh/events{/privacy}","received_events_url":"https://api.github.com/users/baldurh/received_events","type":"User","site_admin":false},"body":"This is mainly a test to see whether this would work for another project. Maybe we don’t want this on `master` but I wanted to get some input on the proper way to implement this.","created_at":"2017-10-06T16:55:53Z","updated_at":"2017-11-02T16:08:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c11d75a8fe8c6aad5628d3dd2a26e57d88b49dcb","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/60/commits","review_comments_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/60/comments","review_comment_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/issues/60/comments","statuses_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/statuses/6d8844f1a76b53f77c8a09f3782231fc23717805","head":{"label":"ueno-llc:feature/css-code-splitting","ref":"feature/css-code-splitting","sha":"6d8844f1a76b53f77c8a09f3782231fc23717805","user":{"login":"ueno-llc","id":11651989,"avatar_url":"https://avatars2.githubusercontent.com/u/11651989?v=4","gravatar_id":"","url":"https://api.github.com/users/ueno-llc","html_url":"https://github.com/ueno-llc","followers_url":"https://api.github.com/users/ueno-llc/followers","following_url":"https://api.github.com/users/ueno-llc/following{/other_user}","gists_url":"https://api.github.com/users/ueno-llc/gists{/gist_id}","starred_url":"https://api.github.com/users/ueno-llc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ueno-llc/subscriptions","organizations_url":"https://api.github.com/users/ueno-llc/orgs","repos_url":"https://api.github.com/users/ueno-llc/repos","events_url":"https://api.github.com/users/ueno-llc/events{/privacy}","received_events_url":"https://api.github.com/users/ueno-llc/received_events","type":"Organization","site_admin":false},"repo":{"id":81570409,"name":"starter-kit-universally","full_name":"ueno-llc/starter-kit-universally","owner":{"login":"ueno-llc","id":11651989,"avatar_url":"https://avatars2.githubusercontent.com/u/11651989?v=4","gravatar_id":"","url":"https://api.github.com/users/ueno-llc","html_url":"https://github.com/ueno-llc","followers_url":"https://api.github.com/users/ueno-llc/followers","following_url":"https://api.github.com/users/ueno-llc/following{/other_user}","gists_url":"https://api.github.com/users/ueno-llc/gists{/gist_id}","starred_url":"https://api.github.com/users/ueno-llc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ueno-llc/subscriptions","organizations_url":"https://api.github.com/users/ueno-llc/orgs","repos_url":"https://api.github.com/users/ueno-llc/repos","events_url":"https://api.github.com/users/ueno-llc/events{/privacy}","received_events_url":"https://api.github.com/users/ueno-llc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ueno-llc/starter-kit-universally","description":"Ueno. starter kit base","fork":false,"url":"https://api.github.com/repos/ueno-llc/starter-kit-universally","forks_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/forks","keys_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/teams","hooks_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/hooks","issue_events_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/issues/events{/number}","events_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/events","assignees_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/assignees{/user}","branches_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/branches{/branch}","tags_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/tags","blobs_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/git/refs{/sha}","trees_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/statuses/{sha}","languages_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/languages","stargazers_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/stargazers","contributors_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/contributors","subscribers_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/subscribers","subscription_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/subscription","commits_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/commits{/sha}","git_commits_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/git/commits{/sha}","comments_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/comments{/number}","issue_comment_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/issues/comments{/number}","contents_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/contents/{+path}","compare_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/merges","archive_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/downloads","issues_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/issues{/number}","pulls_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls{/number}","milestones_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/milestones{/number}","notifications_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/labels{/name}","releases_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/releases{/id}","deployments_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/deployments","created_at":"2017-02-10T14:00:08Z","updated_at":"2017-10-24T05:07:44Z","pushed_at":"2017-11-02T16:01:36Z","git_url":"git://github.com/ueno-llc/starter-kit-universally.git","ssh_url":"git@github.com:ueno-llc/starter-kit-universally.git","clone_url":"https://github.com/ueno-llc/starter-kit-universally.git","svn_url":"https://github.com/ueno-llc/starter-kit-universally","homepage":"http://starter-kit-universally.herokuapp.com/","size":2622,"stargazers_count":88,"watchers_count":88,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":7,"forks":7,"open_issues":7,"watchers":88,"default_branch":"development"}},"base":{"label":"ueno-llc:development","ref":"development","sha":"f16b1d5f9ecdf82006f8a30b56f9b17bf448df15","user":{"login":"ueno-llc","id":11651989,"avatar_url":"https://avatars2.githubusercontent.com/u/11651989?v=4","gravatar_id":"","url":"https://api.github.com/users/ueno-llc","html_url":"https://github.com/ueno-llc","followers_url":"https://api.github.com/users/ueno-llc/followers","following_url":"https://api.github.com/users/ueno-llc/following{/other_user}","gists_url":"https://api.github.com/users/ueno-llc/gists{/gist_id}","starred_url":"https://api.github.com/users/ueno-llc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ueno-llc/subscriptions","organizations_url":"https://api.github.com/users/ueno-llc/orgs","repos_url":"https://api.github.com/users/ueno-llc/repos","events_url":"https://api.github.com/users/ueno-llc/events{/privacy}","received_events_url":"https://api.github.com/users/ueno-llc/received_events","type":"Organization","site_admin":false},"repo":{"id":81570409,"name":"starter-kit-universally","full_name":"ueno-llc/starter-kit-universally","owner":{"login":"ueno-llc","id":11651989,"avatar_url":"https://avatars2.githubusercontent.com/u/11651989?v=4","gravatar_id":"","url":"https://api.github.com/users/ueno-llc","html_url":"https://github.com/ueno-llc","followers_url":"https://api.github.com/users/ueno-llc/followers","following_url":"https://api.github.com/users/ueno-llc/following{/other_user}","gists_url":"https://api.github.com/users/ueno-llc/gists{/gist_id}","starred_url":"https://api.github.com/users/ueno-llc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ueno-llc/subscriptions","organizations_url":"https://api.github.com/users/ueno-llc/orgs","repos_url":"https://api.github.com/users/ueno-llc/repos","events_url":"https://api.github.com/users/ueno-llc/events{/privacy}","received_events_url":"https://api.github.com/users/ueno-llc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ueno-llc/starter-kit-universally","description":"Ueno. starter kit base","fork":false,"url":"https://api.github.com/repos/ueno-llc/starter-kit-universally","forks_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/forks","keys_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/teams","hooks_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/hooks","issue_events_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/issues/events{/number}","events_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/events","assignees_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/assignees{/user}","branches_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/branches{/branch}","tags_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/tags","blobs_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/git/refs{/sha}","trees_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/statuses/{sha}","languages_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/languages","stargazers_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/stargazers","contributors_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/contributors","subscribers_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/subscribers","subscription_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/subscription","commits_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/commits{/sha}","git_commits_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/git/commits{/sha}","comments_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/comments{/number}","issue_comment_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/issues/comments{/number}","contents_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/contents/{+path}","compare_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/merges","archive_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/downloads","issues_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/issues{/number}","pulls_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls{/number}","milestones_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/milestones{/number}","notifications_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/labels{/name}","releases_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/releases{/id}","deployments_url":"https://api.github.com/repos/ueno-llc/starter-kit-universally/deployments","created_at":"2017-02-10T14:00:08Z","updated_at":"2017-10-24T05:07:44Z","pushed_at":"2017-11-02T16:01:36Z","git_url":"git://github.com/ueno-llc/starter-kit-universally.git","ssh_url":"git@github.com:ueno-llc/starter-kit-universally.git","clone_url":"https://github.com/ueno-llc/starter-kit-universally.git","svn_url":"https://github.com/ueno-llc/starter-kit-universally","homepage":"http://starter-kit-universally.herokuapp.com/","size":2622,"stargazers_count":88,"watchers_count":88,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":7,"forks":7,"open_issues":7,"watchers":88,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/60"},"html":{"href":"https://github.com/ueno-llc/starter-kit-universally/pull/60"},"issue":{"href":"https://api.github.com/repos/ueno-llc/starter-kit-universally/issues/60"},"comments":{"href":"https://api.github.com/repos/ueno-llc/starter-kit-universally/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ueno-llc/starter-kit-universally/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/ueno-llc/starter-kit-universally/statuses/6d8844f1a76b53f77c8a09f3782231fc23717805"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"baldurh"}}