Skip to content

Conversation

@vicb
Copy link
Contributor

@vicb vicb commented Oct 24, 2025

Sometimes unenv aliases can point to packages.

For example the base unenv package aliases debug to a shim /unenv/....
But we want to use the actual package instead, so we override that by creating an alias debug -> debug.

Before this PR, the plugin assumed that the alias as to be a path and it would throw when trying to resolve the debug path.
This PR updates the plugin so that it assumes that the alias is a package when it can not be resolved to a path.

This was tested on top of #11079 and solves the test issues there.


  • Tests
    • Tests included
    • Tests not necessary because: tested manuallu, merging 11079 will test that (see details above)
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: fix
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: unenv changes are not backported to v3

@vicb vicb requested review from a team as code owners October 24, 2025 11:56
@changeset-bot
Copy link

changeset-bot bot commented Oct 24, 2025

🦋 Changeset detected

Latest commit: 623549b

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 24, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: 623549b

@vicb vicb changed the title allow resolving unenv aliases to packages [vite plugin] allow resolving unenv aliases to packages Oct 24, 2025
Copy link
Contributor

@jamesopstad jamesopstad left a comment

Choose a reason for hiding this comment

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

Thanks @vicb.

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Oct 24, 2025
@vicb vicb merged commit 57fc660 into main Oct 24, 2025
31 of 33 checks passed
@vicb vicb deleted the vicb/vite-package branch October 24, 2025 12:34
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Oct 24, 2025
vicb added a commit that referenced this pull request Oct 24, 2025
vicb added a commit that referenced this pull request Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants