docs/config/alias.md
Record<string, string> | Array<{ find: string | RegExp, replacement: string, customResolver?: ResolverFunction | ResolverObject }>Define custom aliases when running inside tests. They will be merged with aliases from resolve.alias.
::: warning Vitest uses Vite SSR primitives to run tests which has certain pitfalls.
import keyword by an inlined module (all source code is inlined by default).require calls.react -> preact), you may want to alias the actual node_modules packages instead to make it work for externalized dependencies. Both Yarn and pnpm support aliasing via the npm: prefix.
:::