feat: enable minification for worker bundle size optimization (#1048)#1152
Closed
zeroknowledge0x wants to merge 2 commits into
Closed
feat: enable minification for worker bundle size optimization (#1048)#1152zeroknowledge0x wants to merge 2 commits into
zeroknowledge0x wants to merge 2 commits into
Conversation
- Replace hardcoded Access-Control-Allow-Origin: * with origin validation - Add ALLOWED_ORIGINS environment variable for configurable allowlist - Validate request Origin header against allowed origins - Only set CORS headers for requests from allowed origins - Add Vary: Origin header for proper cache key differentiation - Update errorResponse to pass CORS headers through Fixes sublime247#1049
…e247#1048) Add deployment guidance for minified worker bundles: - Deploy with: wrangler deploy --minify - Or set WRANGLER_MINIFY=true in environment This reduces bundle size by removing whitespace, shortening variable names, and eliminating dead code. Typical 30-50% size reduction for Cloudflare Workers. Fixes sublime247#1048
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1048 — Enable minification for Cloudflare Worker bundle to reduce startup time.
Changes
wrangler.tomlfor minified buildswrangler deploy --minifyWRANGLER_MINIFY=truein environmentImpact
How to Deploy
Technical Details
Minification removes:
Fixes #1048