Skip to content

Commit

Permalink
FIX storybook webpack setup HMR; partial downgrade back to v4.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tgallacher committed Feb 12, 2019
1 parent b12ddaa commit a4ef4b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
28 changes: 10 additions & 18 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
const merge = require('webpack-merge');

const webpackProjectConfig = require('../webpack.common');
//
// you can use this file to add your custom webpack plugins, loaders and anything you like.
// This is just the basic way to add additional webpack configurations.
// For more information refer the docs: https://storybook.js.org/configurations/custom-webpack-config

//
// IMPORTANT
// When you add this file, we won't add the default configurations which is similar
// to "React Create App". This only has babel loader to load JavaScript.
const webpackProjectConfig = require('../webpack.common');

module.exports = {
plugins: webpackProjectConfig.plugins,
module: {
rules: [
// add your custom rules.
],
},
externals: {
'jsdom': 'window',
'cheerio': 'window',
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': 'window',
'react/addons': true,
}
};
module.exports = (storybookBaseConfig, configType) => {
return merge.smart(storybookBaseConfig, {
plugins: webpackProjectConfig.plugins
});
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
"@babel/polyfill": "^7.2.5",
"@babel/preset-env": "^7.3.1",
"@babel/preset-react": "^7.0.0",
"@storybook/addon-actions": "^4.1.11",
"@storybook/addon-links": "^4.1.11",
"@storybook/addon-options": "^4.1.11",
"@storybook/addons": "^4.1.11",
"@storybook/react": "^4.1.11",
"@storybook/addon-actions": "^4.0.4",
"@storybook/addon-links": "^4.0.4",
"@storybook/addon-options": "^4.0.4",
"@storybook/addons": "^4.0.4",
"@storybook/react": "^4.0.4",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.5",
"babel-plugin-emotion": "^9.2.11",
Expand Down

0 comments on commit a4ef4b0

Please sign in to comment.