You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit efba8cb
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/guide/common-errors.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -282,6 +282,8 @@ export default defineConfig({
282
282
})
283
283
```
284
284
285
+
However, Vitest matches these patterns against the full file path of each module, not the package name as Vite does. So an anchored regular expression like `/^@scope\/pkg/` never matches in Vitest. A plain string like `'pkg'` also matches every package whose name starts with it, such as `pkg-utils`.
286
+
285
287
## CommonJS source code is not fully supported
286
288
287
289
Vitest is ESM-first. By default, source files run in Vite's [module runner](/config/experimental#experimental-vitemodulerunner), which provides CommonJS variables such as `require`, `module`, and `exports` for compatibility but does not reproduce Node.js CommonJS semantics completely.
0 commit comments