fix: resolve.tsconfigPaths: true not applied in test environment#10087
Closed
MdSadiqMd wants to merge 3 commits intovitest-dev:mainfrom
Closed
fix: resolve.tsconfigPaths: true not applied in test environment#10087MdSadiqMd wants to merge 3 commits intovitest-dev:mainfrom
MdSadiqMd wants to merge 3 commits intovitest-dev:mainfrom
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
This is not how |
hi-ogawa
requested changes
Apr 8, 2026
Collaborator
hi-ogawa
left a comment
There was a problem hiding this comment.
This isn't testing Vite 8's resolve: { tsconfigPaths: true } config.
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
fixes #10054
This PR fixes an issue where Vitest was not preserving user-defined Vite resolve options when creating its test environment. Previously, custom resolve options like
extensions,dedupe,preserveSymlinks, and options set by Vite plugins (such asvite-tsconfig-paths) were being discarded.The root cause was that both
VitestPluginandWorkspaceVitestPluginwere creating a new resolve configuration that only included Vitest's defaultmainFieldsandconditions, completely ignoringviteConfig.resolve.This fix introduces a
mergeResolveOptions()helper function that:mainFieldsandconditionswith Vitest's required defaults (critical for test environment)This ensures that plugins like
vite-tsconfig-pathswork correctly in Vitest, and any custom resolve configuration is respected in tests while maintaining backward compatibility.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.test/config/test/resolve-options.test.ts- Tests custom resolve options preservationtest/config/test/tsconfig-paths.test.ts- Tests alias resolutionDocumentation
Changesets
feat:,fix:,perf:,docs:, orchore:.