Wrangler Tree Shaking I m having trouble

Wrangler Tree Shaking: I'm having trouble with tree shaking my workers when I bundle via wrangler. Does this happen by default or do I have to enable it? When I run npx wrangler deploy --dry-run --outdir dist --minify=true or npx wrangler deploy --dry-run --outdir dist I can clearly identify dead code that isn't needed for the worker. I've set all my ts modules to "esnext", but still no good. I also don't see any way to adust the esbuild config. Any suggestions?
1 Reply
MBrimmer
MBrimmerOP16mo ago
Looks like my issue may be due to external dependencies that are commonjs. and esbuild can't shake them.
Want results from more Discord servers?
Add your server