fix: enable esbuild minification for worker bundle size reduction#1132
fix: enable esbuild minification for worker bundle size reduction#1132zeroknowledge0x wants to merge 1 commit into
Conversation
Enable wrangler's built-in esbuild minification to reduce the well-known-cache worker bundle size and accelerate cold starts. Fixes sublime247#1048
|
@unsiqasik why are you creating a or for issue that was not assigned to you?? you good?? |
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| - | - | JSON Web Token | 45e3b17 | src/utils/tests/scrub.test.ts | View secret |
| - | - | Bearer Token | 45e3b17 | src/utils/tests/scrub.test.ts | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Fixes #1048
Summary
Enable wrangler's built-in esbuild minification to reduce the well-known-cache worker bundle size and accelerate cold starts.
Changes
minify = truetowrangler.toml— enables esbuild's minification pipeline including dead code elimination, tree-shaking, and identifier manglingTesting
npx wrangler deploy --dry-runto verify the worker builds successfully with minification enablednpx wrangler deploy --outdir distand check file sizesTechnical Details
Cloudflare Workers uses esbuild internally for bundling. The
minify = trueoption enables:This reduces the worker bundle size, resulting in faster cold starts and reduced memory usage.