gajus / isomorphic-webpack

Abstracts universal consumption of application code base using webpack.
Other
291 stars 17 forks source link

CommonsChunkPlugin causing ReferenceError: exports is not defined #22

Closed laggingreflex closed 7 years ago

laggingreflex commented 7 years ago

Adding CommonsChunkPlugin causes ReferenceError: exports is not defined

I think it's because it only reads one of the bundles, probably not reading the one with the webpack bootstrapping code?

repro: https://github.com/laggingreflex/isomorphic-webpack-demo/commit/d76298bf1a213a3c36dfc6edd59da32a5b2f3a83

  plugins: [
    new (require('webpack').optimize.CommonsChunkPlugin)({
      name: 'node_modules',
      minChunks: module => module.context && module.context.indexOf('node_modules') !== -1,
    })
  ],
laggingreflex commented 7 years ago

Dupe #10, sorry. Error message "Multiple bundles are not supported." doesn't appear for implicit entry (as above)