1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

add react production aliases (#1855)

This commit is contained in:
Luke Edwards 2017-05-02 18:27:18 -07:00 committed by Guillermo Rauch
parent d1b61afcf8
commit 87773b98dc

View file

@ -298,6 +298,14 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
performance: { hints: false }
}
if (!dev) {
webpackConfig.resolve.alias = {
'react': require.resolve('react/dist/react.min.js'),
'react-dom': require.resolve('react-dom/dist/react-dom.min.js'),
'react-dom/server': require.resolve('react-dom/dist/react-dom-server.min.js')
}
}
if (config.webpack) {
console.log('> Using "webpack" config function defined in next.config.js.')
webpackConfig = await config.webpack(webpackConfig, { dev })