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:
parent
dd556bf90b
commit
6729fa4580
|
@ -35,6 +35,11 @@ function externalsConfig (dir, isServer, lambdas) {
|
||||||
if (lambdas) {
|
if (lambdas) {
|
||||||
return [
|
return [
|
||||||
(context, request, callback) => {
|
(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) => {
|
resolve(request, { basedir: context, preserveSymlinks: true }, (err, res) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback()
|
return callback()
|
||||||
|
|
Loading…
Reference in a new issue