Remove custom handling for prebundled react env (#49954)

This removes the previous handling for the prebundled react env we were
setting in favor of https://github.com/vercel/vercel/pull/9974

We need to wait to land this until
https://github.com/vercel/vercel/pull/9974 has been rolled

Fixes: https://github.com/vercel/next.js/issues/49169
Fixes: https://github.com/vercel/next.js/issues/49753
x-ref: https://github.com/vercel/next.js/issues/48948
This commit is contained in:
JJ Kasper 2023-05-18 16:51:18 -07:00 committed by GitHub
parent c2da56e194
commit ea9b1f5ebc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -301,23 +301,6 @@ export default async function build(
NextBuildContext.appDir = appDir
hasAppDir = Boolean(appDir)
if (isAppDirEnabled && hasAppDir) {
if (
(!process.env.__NEXT_TEST_MODE ||
process.env.__NEXT_TEST_MODE === 'e2e') &&
ciEnvironment.hasNextSupport
) {
const requireHook = require.resolve('../server/require-hook')
const contents = await promises.readFile(requireHook, 'utf8')
await promises.writeFile(
requireHook,
`process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = '${
config.experimental.serverActions ? 'experimental' : 'next'
}'\n${contents}`
)
}
}
const isSrcDir = path
.relative(dir, pagesDir || appDir || '')
.startsWith('src')