Source: Dev.to | Jan 15, 2026 (UTC)
Here is a short, clean, blog‑friendly version that reflects your actual discovery:
How I Shrunk My Serverless Bundle by Discovering One Unexpected esbuild Issue
Today I finally solved a packaging problem that had bothered me for weeks:
no matter how many package.patterns I added — excluding Prisma engines, WASM files, TypeScript runtime, sourcemaps, caches — my AWS Lambda bundle never changed.
It didn’t matter if I excluded a few files or excluded everything.
The ZIP size stayed exactly the same.
Surprisingly, the fix had nothing to do with tree‑shaking, Prisma engine types, or exclude patterns.
The real culprit was something much simpler.
Problem: package.patterns didn’t work at all
I kept seeing massive files in the final ZIP:
-
@prisma/engines/** -
query_engine_bg.*.wasm-base64.js -
*.wasm -
typescript/** -
prisma/**
Even if I removed all patterns:
package: patterns: []
Enter fullscreen mode
Exit fullscreen mode


Залишити відповідь