Skip to content

Commit 6ea3de2

Browse files
Stvadclaude
andcommitted
docs(qa): fix vite-qa invocation example for worktrees
The documented `node node_modules/vite/bin/vite.js` exits with MODULE_NOT_FOUND from a worktree (no node_modules/vite there; the path is a literal file arg, not a package lookup), and Vite's package exports hide the bin from require.resolve. Document a form that points node directly at the installed binary, derived from git so it works from a worktree or a normal checkout at any nesting depth. Comment-only; verified the command boots the server. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5c334a6 commit 6ea3de2

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

scripts/vite-qa.config.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ import base from '../vite.config.ts'
2121
// Kept as plain .mjs (like webkit-qa.mjs) so `tsc -b` doesn't typecheck it
2222
// against the app's vite config types.
2323
//
24-
// node node_modules/vite/bin/vite.js \
25-
// --config scripts/vite-qa.config.mjs --port 5199 --strictPort
24+
// Run from the worktree root, pointing node DIRECTLY at the installed Vite
25+
// binary. The worktree has no node_modules/vite of its own (so the bare
26+
// `node node_modules/vite/bin/vite.js` exits with MODULE_NOT_FOUND), and Vite's
27+
// package `exports` don't expose the bin to require.resolve — so derive the
28+
// checkout that holds it from git. This form works from a worktree or a normal
29+
// checkout regardless of nesting depth:
2630
//
27-
// (run from the worktree root; node resolves vite up to the main checkout.)
31+
// node "$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")/node_modules/vite/bin/vite.js" \
32+
// --config scripts/vite-qa.config.mjs --port 5199 --strictPort
2833
const worktreeRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
2934
// Walk up to the nearest ancestor whose node_modules holds REAL packages (the
3035
// main checkout, when run from a worktree; the worktree itself for a normal

0 commit comments

Comments
 (0)