Commit 334863a
committed
fix(test): resolve vendor-aliases paths from package root, not distRoot (#985)
The vendorMap in the vendor-aliases plugin was resolving @vitest/* paths
relative to distRoot (dist/@vitest/browser/), producing doubled paths like
dist/@vitest/browser/@vitest/browser/context.js. Use packageRoot (dist/)
instead, fixing resolution for third-party imports like @storybook/addon-vitest.
- Close #963
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: a one-line change in the test build-time patcher that only affects how `@vitest/*` alias paths are resolved in the injected browser plugin.
>
> **Overview**
> Fixes the injected `vitest:vendor-aliases` plugin so its `@vitest/*` alias map resolves files from the dist *package root* (`packageRoot`/`dist/`) instead of `distRoot` (`dist/@vitest/browser/`).
>
> This prevents incorrect doubled paths when third-party tools import `@vitest/*` modules in browser mode.
>
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 33c6164. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 8f8bcce commit 334863a
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1459 | 1459 | | |
1460 | 1460 | | |
1461 | 1461 | | |
1462 | | - | |
| 1462 | + | |
1463 | 1463 | | |
1464 | 1464 | | |
1465 | 1465 | | |
| |||
0 commit comments