-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Add more optimizeDeps for Cloudflare prebundling #15026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Cloudflare does some prebundling, and Astro entrypoints (like astro/runtime and astro/app are prebundled. We need to exclude the virtual modules which can't be prebundled by esbuild. This is based on a demo app that failed without this config.
🦋 Changeset detectedLatest commit: 5a7bf49 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
| 📦 Package | 🔒 Before | 🔓 After |
|---|---|---|
| @cloudflare/unenv-preset | trusted-with-provenance | none |
| workerd | trusted-with-provenance | none |
| undici | provenance | none |
| miniflare | trusted-with-provenance | none |
| youch | provenance | none |
| @cloudflare/workerd-darwin-64 | trusted-with-provenance | none |
| @cloudflare/workerd-darwin-arm64 | trusted-with-provenance | none |
| @cloudflare/workerd-linux-64 | trusted-with-provenance | none |
| @cloudflare/workerd-linux-arm64 | trusted-with-provenance | none |
| @cloudflare/workerd-windows-64 | trusted-with-provenance | none |
| wrangler | trusted-with-provenance | none |
| 'unstorage/drivers/cloudflare-kv-binding', | ||
| 'astro:toolbar:internal', | ||
| 'virtual:astro:middleware', | ||
| 'virtual:astro:dev-css-all', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this support regexes? If so we could exclude all imports that start with virtual:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It supports tinyglob patterns so maybe. I'll try this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glob works, thanks for the idea!
|
I'm still seeing an issue with the build in my test project, going to hold off on merging until I solve that. |
|
Ah, that was because my local changes were wiped out, it's working now. |
Co-authored-by: Florian Lefebvre <[email protected]>
Changes
Testing
This is based on a demo app that failed without this config.
Docs
N/A, bug fix