Skip to content

fix(tia): load rolldown from vite/rolldown under Vite+ - #2061

Open
benddailey wants to merge 2 commits into
pestphp:5.xfrom
benddailey:fix/tia-vite-plus-rolldown
Open

benddailey wants to merge 2 commits into
pestphp:5.xfrom
benddailey:fix/tia-vite-plus-rolldown

Conversation

@benddailey

Copy link
Copy Markdown

What:

  • Bug Fix
  • New Feature

Description:

Vite+ (@voidzero-dev/vite-plus-core, installed as vite) exposes rolldown only as the subpath export vite/rolldown. loadRolldown() did not look there, so TIA recorded an empty JS module graph and re-ran the whole suite on each front-end change.

This PR adds a third lookup to loadRolldown(): projectRequire.resolve('vite/rolldown'), after the top-level rolldown and the rolldown that vite depends on. It also exports loadRolldown(projectRoot = PROJECT_ROOT), the same way as loadAliasFromTsconfig(), so a test can call it.

Tests in tests/Unit/Plugins/Tia/ViteDepsHelper.php:

  • A fixture with node_modules/vite/package.json that exports ./rolldown, and no node_modules/rolldown: loadRolldown() returns that module.
  • A fixture with neither package: loadRolldown() returns null.

Related:

Closes #2060

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TIA records an empty JS module graph under Vite+ (rolldown only at vite/rolldown)

1 participant