Skip to content

Commit fc8b892

Browse files
committed
fix: externalize node: built-ins from client bundle
Fixes build with linked @TanStack packages that import Node.js built-ins
1 parent 50e66eb commit fc8b892

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vite.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ export default defineConfig({
106106
rollupOptions: {
107107
external: (id) => {
108108
// Externalize postgres from client bundle
109-
return id.includes('postgres')
109+
if (id.includes('postgres')) return true
110+
// Externalize Node.js built-in modules that linked packages import
111+
// These should never be in client bundles
112+
if (id.startsWith('node:')) return true
113+
return false
110114
},
111115
output: {
112116
manualChunks: (id) => {

0 commit comments

Comments
 (0)