Skip to content

Commit

Permalink
refactor: simplify SSR options' if statement (#13254)
Browse files Browse the repository at this point in the history
  • Loading branch information
Saeed-Paris authored May 22, 2023
1 parent 906c4c1 commit 8013a66
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/vite/src/node/ssr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,8 @@ export function resolveSSROptions(
): ResolvedSSROptions {
ssr ??= {}
const optimizeDeps = ssr.optimizeDeps ?? {}
let format: SSRFormat = 'esm'
let target: SSRTarget = 'node'
if (buildSsrCjsExternalHeuristics) {
if (ssr) {
format = 'cjs'
} else {
target = 'node'
format = 'cjs'
}
}
const format: SSRFormat = buildSsrCjsExternalHeuristics ? 'cjs' : 'esm'
const target: SSRTarget = 'node'
return {
format,
target,
Expand Down

0 comments on commit 8013a66

Please sign in to comment.