Skip to content

Commit

Permalink
refactor: simplify SSR options' if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Saeed-Paris authored and Saeed-Paris committed May 19, 2023
1 parent 3f3fff2 commit 668ec2c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/vite/src/node/ssr/index.ts
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 668ec2c

Please sign in to comment.