fix(vite-plus): search for node_modules/.bin before resolving to native package#223
Merged
Sysix merged 3 commits intoApr 21, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the VS Code extension’s binary resolution order so that project-generated wrappers in node_modules/.bin (e.g., created by vite-plus) are preferred over resolving the package’s native/bin entry via require.resolve, ensuring the tools run with the intended vite-plus context.
Changes:
- Reorders project binary discovery to search
node_modules/.bin(workspace + monorepo subfolders) before falling back torequire.resolve. - Reorders global binary discovery to search global
node_modules/.binbefore falling back torequire.resolve.
Comments suppressed due to low confidence (1)
client/findBinary.ts:101
- On Windows,
node_modules/.binentries are commonly*.cmd/*.ps1shims. With this new resolution order, correctness depends onsearchNodeModulesDefaultBinPath()choosing a runnable file; today it only checks the extensionless path and.exe, which can select a non-cmd shim and fail to launch undershell: true. Consider updating the.bincandidate list to prefer.cmd(and possibly.ps1) on win32.
// fallback to direct binary lookup in workspace node_modules/.bin
const workspaceNodeModules = (workspace.workspaceFolders ?? []).map((folder) =>
path.join(folder.uri.fsPath, "node_modules"),
);
const result = await searchNodeModulesDefaultBinPath(binaryName, workspaceNodeModules);
if (result) {
return result;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alexander S. <sysix@sysix-coding.de>
9 tasks
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.
When the extension searches for
oxlintoroxfmt, it first tried to resolve it viarequire.resolve, which resulted in a path like:This will execute the binaries with its native settings, without
vite-pluscontext.With this fix, it will search for
node_modules/.bin/oxlintfirst, which was created byvite-plusitself.related #215