{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/addons-frontend/issues/6172","repository_url":"https://api.github.com/repos/mozilla/addons-frontend","labels_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/6172/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/6172/comments","events_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/6172/events","html_url":"https://github.com/mozilla/addons-frontend/issues/6172","id":358010033,"node_id":"MDU6SXNzdWUzNTgwMTAwMzM=","number":6172,"title":"Do not duplicate the webpack config in storybook","user":{"login":"willdurand","id":217628,"node_id":"MDQ6VXNlcjIxNzYyOA==","avatar_url":"https://avatars0.githubusercontent.com/u/217628?v=4","gravatar_id":"","url":"https://api.github.com/users/willdurand","html_url":"https://github.com/willdurand","followers_url":"https://api.github.com/users/willdurand/followers","following_url":"https://api.github.com/users/willdurand/following{/other_user}","gists_url":"https://api.github.com/users/willdurand/gists{/gist_id}","starred_url":"https://api.github.com/users/willdurand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willdurand/subscriptions","organizations_url":"https://api.github.com/users/willdurand/orgs","repos_url":"https://api.github.com/users/willdurand/repos","events_url":"https://api.github.com/users/willdurand/events{/privacy}","received_events_url":"https://api.github.com/users/willdurand/received_events","type":"User","site_admin":false},"labels":[{"id":820354953,"node_id":"MDU6TGFiZWw4MjAzNTQ5NTM=","url":"https://api.github.com/repos/mozilla/addons-frontend/labels/priority:%20p3","name":"priority: p3","color":"a4000f","default":false},{"id":1048414643,"node_id":"MDU6TGFiZWwxMDQ4NDE0NjQz","url":"https://api.github.com/repos/mozilla/addons-frontend/labels/storybook","name":"storybook","color":"f2e6e6","default":false}],"state":"closed","locked":false,"assignee":{"login":"rebmullin","id":1986001,"node_id":"MDQ6VXNlcjE5ODYwMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1986001?v=4","gravatar_id":"","url":"https://api.github.com/users/rebmullin","html_url":"https://github.com/rebmullin","followers_url":"https://api.github.com/users/rebmullin/followers","following_url":"https://api.github.com/users/rebmullin/following{/other_user}","gists_url":"https://api.github.com/users/rebmullin/gists{/gist_id}","starred_url":"https://api.github.com/users/rebmullin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebmullin/subscriptions","organizations_url":"https://api.github.com/users/rebmullin/orgs","repos_url":"https://api.github.com/users/rebmullin/repos","events_url":"https://api.github.com/users/rebmullin/events{/privacy}","received_events_url":"https://api.github.com/users/rebmullin/received_events","type":"User","site_admin":false},"assignees":[{"login":"rebmullin","id":1986001,"node_id":"MDQ6VXNlcjE5ODYwMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1986001?v=4","gravatar_id":"","url":"https://api.github.com/users/rebmullin","html_url":"https://github.com/rebmullin","followers_url":"https://api.github.com/users/rebmullin/followers","following_url":"https://api.github.com/users/rebmullin/following{/other_user}","gists_url":"https://api.github.com/users/rebmullin/gists{/gist_id}","starred_url":"https://api.github.com/users/rebmullin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebmullin/subscriptions","organizations_url":"https://api.github.com/users/rebmullin/orgs","repos_url":"https://api.github.com/users/rebmullin/repos","events_url":"https://api.github.com/users/rebmullin/events{/privacy}","received_events_url":"https://api.github.com/users/rebmullin/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/mozilla/addons-frontend/milestones/125","html_url":"https://github.com/mozilla/addons-frontend/milestone/125","labels_url":"https://api.github.com/repos/mozilla/addons-frontend/milestones/125/labels","id":3625333,"node_id":"MDk6TWlsZXN0b25lMzYyNTMzMw==","number":125,"title":"2018.10.18","description":"[Push Doc](https://github.com/mozilla/addons/blob/master/releases/2018/10/18.md)","creator":{"login":"muffinresearch","id":1514,"node_id":"MDQ6VXNlcjE1MTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1514?v=4","gravatar_id":"","url":"https://api.github.com/users/muffinresearch","html_url":"https://github.com/muffinresearch","followers_url":"https://api.github.com/users/muffinresearch/followers","following_url":"https://api.github.com/users/muffinresearch/following{/other_user}","gists_url":"https://api.github.com/users/muffinresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/muffinresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muffinresearch/subscriptions","organizations_url":"https://api.github.com/users/muffinresearch/orgs","repos_url":"https://api.github.com/users/muffinresearch/repos","events_url":"https://api.github.com/users/muffinresearch/events{/privacy}","received_events_url":"https://api.github.com/users/muffinresearch/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":26,"state":"open","created_at":"2018-09-05T15:30:52Z","updated_at":"2018-10-15T20:40:44Z","due_on":"2018-10-16T07:00:00Z","closed_at":null},"comments":1,"created_at":"2018-09-07T10:24:07Z","updated_at":"2018-10-16T09:47:59Z","closed_at":"2018-10-15T17:13:54Z","author_association":"MEMBER","body":"The `stories/setup/webpack.config.babel.js` duplicates a lot of webpack config that is already present in `webpack.dev.config.babel.js`.\r\n\r\nWe should avoid that and require the `webpack.dev.config.babel.js` file in  `stories/setup/webpack.config.babel.js`. From there, we can reuse parts of the config we are interested in. Here is a working patch:\r\n\r\n```diff\r\ndiff --git a/stories/setup/webpack.config.babel.js b/stories/setup/webpack.config.babel.js\r\nindex 8633795ab..d52f2b18e 100644\r\n--- a/stories/setup/webpack.config.babel.js\r\n+++ b/stories/setup/webpack.config.babel.js\r\n@@ -1,58 +1,9 @@\r\n-import 'core/polyfill';\r\n-\r\n-import path from 'path';\r\n-\r\n-import config from 'config';\r\n-import autoprefixer from 'autoprefixer';\r\n-import webpack from 'webpack';\r\n-\r\n-import { getClientConfig } from 'core/utils';\r\n+import webpackDevConfig from '../../webpack.dev.config.babel';\r\n \r\n module.exports = {\r\n   module: {\r\n-    rules: [\r\n-      {\r\n-        test: /\\.svg$/,\r\n-        use: [{ loader: 'svg-url-loader', options: { limit: 10000 } }],\r\n-      },\r\n-      {\r\n-        test: /\\.scss$/,\r\n-        use: [\r\n-          { loader: 'style-loader' },\r\n-          { loader: 'css-loader', options: { importLoaders: 2 } },\r\n-          {\r\n-            loader: 'postcss-loader',\r\n-            options: {\r\n-              plugins: [\r\n-                autoprefixer({\r\n-                  browsers: ['last 2 versions'],\r\n-                  grid: false,\r\n-                }),\r\n-              ],\r\n-            },\r\n-          },\r\n-          { loader: 'sass-loader', options: { outputStyle: 'expanded' } },\r\n-        ],\r\n-      },\r\n-    ],\r\n-  },\r\n-  // The following plugins are needed to help handle\r\n-  // server-side imported components such as core/logger.\r\n-  // Is this the best way??\r\n-  plugins: [\r\n-    new webpack.DefinePlugin({\r\n-      CLIENT_CONFIG: JSON.stringify(getClientConfig(config)),\r\n-    }),\r\n-\r\n-    new webpack.NormalModuleReplacementPlugin(\r\n-      /config$/,\r\n-      'core/client/config.js',\r\n-    ),\r\n-  ],\r\n-  resolve: {\r\n-    alias: {\r\n-      normalize: 'normalize.css/normalize.css',\r\n-    },\r\n-    modules: [path.resolve('./src'), 'node_modules'],\r\n+    rules: webpackDevConfig.module.rules,\r\n   },\r\n+  plugins: webpackDevConfig.plugins,\r\n+  resolve: webpackDevConfig.resolve,\r\n };\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/mozilla/addons-frontend/issues/comments/430174153","html_url":"https://github.com/mozilla/addons-frontend/issues/6172#issuecomment-430174153","issue_url":"https://api.github.com/repos/mozilla/addons-frontend/issues/6172","id":430174153,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDE3NDE1Mw==","user":{"login":"ioanarusiczki","id":33448286,"node_id":"MDQ6VXNlcjMzNDQ4Mjg2","avatar_url":"https://avatars2.githubusercontent.com/u/33448286?v=4","gravatar_id":"","url":"https://api.github.com/users/ioanarusiczki","html_url":"https://github.com/ioanarusiczki","followers_url":"https://api.github.com/users/ioanarusiczki/followers","following_url":"https://api.github.com/users/ioanarusiczki/following{/other_user}","gists_url":"https://api.github.com/users/ioanarusiczki/gists{/gist_id}","starred_url":"https://api.github.com/users/ioanarusiczki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ioanarusiczki/subscriptions","organizations_url":"https://api.github.com/users/ioanarusiczki/orgs","repos_url":"https://api.github.com/users/ioanarusiczki/repos","events_url":"https://api.github.com/users/ioanarusiczki/events{/privacy}","received_events_url":"https://api.github.com/users/ioanarusiczki/received_events","type":"User","site_admin":false},"created_at":"2018-10-16T09:47:59Z","updated_at":"2018-10-16T09:47:59Z","author_association":"NONE","body":"@willdurand Is this \"qa not needed\" ?"}}
{"actor":{"display_login":"ioanarusiczki"}}