Skip to content

Conversation

@matthewp
Copy link
Contributor

Changes

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

Testing

This is based on a demo app that failed without this config.

Docs

N/A, bug fix

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-bot
Copy link

changeset-bot bot commented Dec 15, 2025

🦋 Changeset detected

Latest 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

@github-actions github-actions bot added pkg: integration Related to any renderer integration (scope) pkg: astro Related to the core `astro` package (scope) labels Dec 15, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 15, 2025

⚠️ Package Trust Level Decreased

Caution

Decreased trust levels may indicate a higher risk of supply chain attacks. Please review these changes carefully.

📦 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',
Copy link
Member

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:

Copy link
Contributor Author

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.

Copy link
Contributor Author

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!

@matthewp matthewp marked this pull request as ready for review December 16, 2025 13:06
@matthewp
Copy link
Contributor Author

I'm still seeing an issue with the build in my test project, going to hold off on merging until I solve that.

@matthewp matthewp added the pr preview Apply this label to a PR to generate a preview release label Dec 16, 2025
@matthewp
Copy link
Contributor Author

Ah, that was because my local changes were wiped out, it's working now.

@matthewp matthewp merged commit 90c608c into next Dec 16, 2025
22 checks passed
@matthewp matthewp deleted the more-optimize-deps branch December 16, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope) pr preview Apply this label to a PR to generate a preview release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants