Skip to content

Commit

Permalink
Fix #204 (#401)
Browse files Browse the repository at this point in the history
React addons require React in a special way.
That causes Webpack to push React into the app's bundle.
This fix adds new externals entries to prevent that.
  • Loading branch information
arunoda authored and rauchg committed Dec 16, 2016
1 parent 45e36fd commit aa6870a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/build/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,12 @@ export default async function createCompiler (dir, { hotReload = false, dev = fa
[require.resolve('../../lib/link')]: 'next/link',
[require.resolve('../../lib/prefetch')]: 'next/prefetch',
[require.resolve('../../lib/css')]: 'next/css',
[require.resolve('../../lib/head')]: 'next/head'
[require.resolve('../../lib/head')]: 'next/head',
// React addons ask for React like this.
// That causes webpack to push react into the app's bundle.
// This fix simply prevents that and ask to use React from the next-bundle
'./React': 'react',
'./ReactDOM': 'react-dom'
}
],
resolve: {
Expand Down

0 comments on commit aa6870a

Please sign in to comment.