Skip to content

fix: enable esbuild minification for worker bundle size reduction#1132

Closed
zeroknowledge0x wants to merge 1 commit into
sublime247:mainfrom
zeroknowledge0x:fix/compress-worker-bundle-assets-1048
Closed

fix: enable esbuild minification for worker bundle size reduction#1132
zeroknowledge0x wants to merge 1 commit into
sublime247:mainfrom
zeroknowledge0x:fix/compress-worker-bundle-assets-1048

Conversation

@zeroknowledge0x
Copy link
Copy Markdown

Fixes #1048

Summary

Enable wrangler's built-in esbuild minification to reduce the well-known-cache worker bundle size and accelerate cold starts.

Changes

  • Add minify = true to wrangler.toml — enables esbuild's minification pipeline including dead code elimination, tree-shaking, and identifier mangling

Testing

  • Run npx wrangler deploy --dry-run to verify the worker builds successfully with minification enabled
  • Compare bundle size before and after: npx wrangler deploy --outdir dist and check file sizes

Technical Details

Cloudflare Workers uses esbuild internally for bundling. The minify = true option enables:

  • Dead code elimination — removes unused code paths
  • Tree-shaking — eliminates unused exports
  • Identifier mangling — shortens variable/function names
  • Whitespace removal — compresses output

This reduces the worker bundle size, resulting in faster cold starts and reduced memory usage.

Enable wrangler's built-in esbuild minification to reduce the
well-known-cache worker bundle size and accelerate cold starts.

Fixes sublime247#1048
@sublime247
Copy link
Copy Markdown
Owner

@unsiqasik why are you creating a or for issue that was not assigned to you??

you good??

@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented May 30, 2026

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
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
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. 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


🦉 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.

@sublime247 sublime247 closed this May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GOOD FIRST ISSUE] Compress worker bundle assets sizes

3 participants