Skip to content

Commit 970e8e0

Browse files
committed
build: fix build warnings & reduce bundle size
1 parent c860e46 commit 970e8e0

1 file changed

Lines changed: 7 additions & 16 deletions

File tree

vite.config.ts

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,16 @@ export default defineConfig({
1111
formats: ["cjs"],
1212
},
1313
outDir: "dist",
14+
target: "node20",
1415
rollupOptions: {
16+
// Externalize all node builtins and all dependencies
1517
external: [
16-
"node:os",
17-
"node:path",
18-
"node:fs",
19-
"node:fs/promises",
20-
"node:constants",
21-
"node:child_process",
22-
"node:util",
23-
"date-fns",
24-
"date-fns/add",
25-
"date-fns/format",
26-
"date-fns/parseISO",
27-
"glob",
28-
"handlebars",
29-
"handlebars/runtime",
30-
"massarg",
31-
"massarg/command",
18+
/^node:/, // Node builtins
19+
/^[^./]/, // All bare imports (dependencies)
3220
],
21+
output: {
22+
exports: "named",
23+
},
3324
},
3425
sourcemap: true,
3526
minify: false,

0 commit comments

Comments
 (0)