diff --git a/packages/next/build/babel/preset.ts b/packages/next/build/babel/preset.ts index 8c6ecc097fa1e..76c2aa41874a7 100644 --- a/packages/next/build/babel/preset.ts +++ b/packages/next/build/babel/preset.ts @@ -65,9 +65,9 @@ module.exports = ( const supportsESM = api.caller(supportsStaticESM) const isServer = api.caller((caller: any) => !!caller && caller.isServer) const isModern = api.caller((caller: any) => !!caller && caller.isModern) - const hasJsxRuntime = Boolean( - api.caller((caller: any) => !!caller && caller.hasJsxRuntime) - ) + const hasJsxRuntime = + Boolean(api.caller((caller: any) => !!caller && caller.hasJsxRuntime)) && + isProduction const isLaxModern = isModern ||