Skip to content

Instantly share code, notes, and snippets.

@duranmla
Created February 24, 2017 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duranmla/70e1fbc97e10c3978cef9d8e340ef977 to your computer and use it in GitHub Desktop.
Save duranmla/70e1fbc97e10c3978cef9d8e340ef977 to your computer and use it in GitHub Desktop.
webpack configuration to work with storybook and apollo-client
// load the default config generator.
var genDefaultConfig = require('@kadira/storybook/dist/server/config/defaults/webpack.config.js');
module.exports = function (config, env) {
var conf = genDefaultConfig(config, env);
// add es6 support for node_modules
// config structure is here
// https://github.com/storybooks/react-storybook/blob/d0fd01054f02e79518d36a6fbb238c24577fef83/dist/server/config/webpack.config.js
conf.module.loaders[0].exclude = /node_modules\/(?!(apollo-client)\/).*/;
return conf;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment