Skip to content

Commit 8013a66

Browse files
authoredMay 22, 2023
refactor: simplify SSR options' if statement (#13254)
1 parent 906c4c1 commit 8013a66

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed
 

‎packages/vite/src/node/ssr/index.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,8 @@ export function resolveSSROptions(
4747
): ResolvedSSROptions {
4848
ssr ??= {}
4949
const optimizeDeps = ssr.optimizeDeps ?? {}
50-
let format: SSRFormat = 'esm'
51-
let target: SSRTarget = 'node'
52-
if (buildSsrCjsExternalHeuristics) {
53-
if (ssr) {
54-
format = 'cjs'
55-
} else {
56-
target = 'node'
57-
format = 'cjs'
58-
}
59-
}
50+
const format: SSRFormat = buildSsrCjsExternalHeuristics ? 'cjs' : 'esm'
51+
const target: SSRTarget = 'node'
6052
return {
6153
format,
6254
target,

0 commit comments

Comments
 (0)
Please sign in to comment.