Skip to content

Conversation

dom96
Copy link
Contributor

@dom96 dom96 commented Sep 29, 2025

Certain packages, like django, install a lot of additional files into python_modules which shouldn't be bundled in the worker. Some of these files are so large in aggregate that they balloon up the size of the bundle past limits.

This PR adds certain file extensions that we shouldn't be including. We can expand this list later in the future as we find other file types that shouldn't be included.


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: fixes to existing feature
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: new feature

Test Plan

pnpm run test --filter wrangler -- -t "should print vendor modules correctly in table" src/__tests__/deploy.test.ts

@dom96 dom96 requested a review from a team as a code owner September 29, 2025 10:54
Copy link

changeset-bot bot commented Sep 29, 2025

⚠️ No Changeset found

Latest commit: 7fae0c6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

pkg-pr-new bot commented Sep 29, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@10803

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@10803

miniflare

npm i https://pkg.pr.new/miniflare@10803

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@10803

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@10803

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@10803

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@10803

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@10803

wrangler

npm i https://pkg.pr.new/wrangler@10803

commit: 7fae0c6

!m.name.endsWith(".css") &&
!m.name.endsWith(".gz") &&
!m.name.endsWith(".txt") &&
!m.name.endsWith(".js")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excluding .js files is going to break urllib3 again. It also seems to me that it is impossible to override these filters from wrangler.jsonc file? What if someone explicitly wants to include one of these file types?

!m.name.endsWith(".png") &&
!m.name.endsWith(".jpg") &&
!m.name.endsWith(".css") &&
!m.name.endsWith(".gz") &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any way to customize these? because django needs to load this specific .gz common-passwords.txt.gz

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I included it because it was in your screenshot

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad sorry

@dom96
Copy link
Contributor Author

dom96 commented Oct 9, 2025

Closing in favour of #10927

@dom96 dom96 closed this Oct 9, 2025
@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants