-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
Hi Colin!
Awesome project, I came across this issue as referred by the following:
Originally posted by @gustavopch in #294 (comment)
The thread confirms your intention of having tree-shakable esm code, and it is marked as resolved and closed. However, esbuild currently bundles all of Zod into your output if you import a simple zod schema.
Steps to replicate:
- Creating a simple ts project that uses esbuild with bundled output enabled.
- Create a simple zod schema:
import {z} from "zod" const testSchema = z.string().min(10)
- Validate some random string using the test schema
- Build the project with esbuild using bundled output (also bundling external node_modules, so would be zod module in our case. This is currently how edge functions such as wrangler cli for cloudflare workers bundle ts, and the bundled code is several thousand lines of unused js from Zod in an edge environment supposed to be small and lightweight)
Another similar comment in thread:
Originally posted by @ekwoka in #294 (comment)
Is treeshaking working as expected? Looking forward to hearing from you,
Cheers!
gustavopch, joaopedrodcf, jonioni, msquinn, rafaell-lycan and 25 more
Metadata
Metadata
Assignees
Labels
No labels