提交 aa6870a4 编写于 作者: A Arunoda Susiripala 提交者: Guillermo Rauch

Fix #204 (#401)

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.
上级 45e36fdf
......@@ -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: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册