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:
parent
d1b61afcf8
commit
87773b98dc
|
@ -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 })
|
||||
|
|
Loading…
Reference in a new issue