Skip to content

Commit

Permalink
shorten the teranry
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz committed May 31, 2022
1 parent ab39fe1 commit 3b73fce
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/next/build/analysis/get-page-static-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,12 @@ export async function getPageStaticInfo(params: {
const swcAST = await parseModule(pageFilePath, fileContent)
const { ssg, ssr } = checkExports(swcAST)
const config = tryToExtractExportedConstValue(swcAST, 'config') || {}

const runtime =
config?.runtime === 'edge'
? 'edge'
: // For Node.js runtime, we do static optimization.
config?.runtime === 'nodejs'
? ssr || ssg
? 'nodejs'
: undefined
: // When the runtime is required because there is ssr or ssg we fallback
ssr || ssg
? nextConfig.experimental?.runtime
: ssr || ssg
? config?.runtime || nextConfig.experimental?.runtime
: undefined

const middlewareConfig =
Expand Down

0 comments on commit 3b73fce

Please sign in to comment.