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

Mark react/react-dom as external when in lambdas mode (#5828)

This commit is contained in:
Tim Neutkens 2018-12-05 22:40:17 +01:00 committed by Guillermo Rauch
parent dd556bf90b
commit 6729fa4580

View file

@ -35,6 +35,11 @@ function externalsConfig (dir, isServer, lambdas) {
if (lambdas) {
return [
(context, request, callback) => {
// Make react/react-dom external until we bundle the server/renderer.
if (request === 'react' || request === 'react-dom') {
return callback(null, `commonjs ${request}`)
}
resolve(request, { basedir: context, preserveSymlinks: true }, (err, res) => {
if (err) {
return callback()