Skip to content

Commit 83b3d61

Browse files
authored
Handle ssr.external: true for isDepExternaled (#19)
1 parent 2448868 commit 83b3d61

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: src/sync.cjs

+10-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@ function isDepNoExternaled(dep, ssrNoExternal) {
2424

2525
/** @type {import('./index.d.ts').isDepExternaled} */
2626
function isDepExternaled(dep, ssrExternal) {
27-
return ssrExternal.includes(dep)
27+
// If `ssrExternal` is `true`, it just means that all linked
28+
// dependencies should also be externalized by default. It doesn't
29+
// mean that a dependency is being explicitly externalized. So we
30+
// return `false` in this case.
31+
// @ts-expect-error can be true in Vite 6
32+
if (ssrExternal === true) {
33+
return false
34+
} else {
35+
return ssrExternal.includes(dep)
36+
}
2837
}
2938

3039
/**

0 commit comments

Comments
 (0)