Commit 87773b98 authored by Luke Edwards's avatar Luke Edwards Committed by Guillermo Rauch

add react production aliases (#1855)

parent d1b61afc
...@@ -298,6 +298,14 @@ export default async function createCompiler (dir, { dev = false, quiet = false, ...@@ -298,6 +298,14 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
performance: { hints: 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) { if (config.webpack) {
console.log('> Using "webpack" config function defined in next.config.js.') console.log('> Using "webpack" config function defined in next.config.js.')
webpackConfig = await config.webpack(webpackConfig, { dev }) webpackConfig = await config.webpack(webpackConfig, { dev })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment