diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js index ee0ae51..fa9dc88 100644 --- a/.storybook/webpack.config.js +++ b/.storybook/webpack.config.js @@ -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 + }); +} diff --git a/package.json b/package.json index cf84adc..c004334 100644 --- a/package.json +++ b/package.json @@ -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",