title: Exports not defined - Storybook + webpack 3 + babel 7 + commonjs
body: <p>I am working on a legacy code base. A few modules are in commonjs and a few are es6 modules. Recently, when I try to upgrade to babel 7, I receive the following error while trying to run the storybook:</p>
  
  <blockquote>
    <p>exports is not defined
    ReferenceError: exports is not defined</p>
  </blockquote>
  
  <p>The project uses storybook 3, webpack 3. Here is a snapshot of my babel.config.js</p>
  
  <pre><code>module.exports = function config(api) {
    api.cache(false);
    const presets = [
      [
        '@babel/preset-env',
        {
          modules: false,
        },
      ],
      '@babel/preset-flow',
      '@babel/preset-react'
    ];
    const plugins = [
      '@babel/plugin-syntax-dynamic-import',
      '@babel/plugin-proposal-class-properties',
      '@babel/plugin-proposal-object-rest-spread',
      '@babel/plugin-transform-modules-commonjs',
    ];
  
    return {
      presets,
      plugins,
    };
  };
  </code></pre>
  
  <p>Snapshot of webpack.config:</p>
  
  <pre><code>{
      test: /\.js$/,
      include: [
        path.resolve('src'),
      ],
      loader: 'babel-loader',
    },
  </code></pre>