···11-import type { CommonServerOptions } from 'vite'
11+import type { AliasOptions, CommonServerOptions } from 'vite'
22import type { PrettyFormatOptions } from 'pretty-format'
33import type { FakeTimerInstallOpts } from '@sinonjs/fake-timers'
44import type { BuiltinReporters } from '../node/reporters'
···393393 */
394394 seed?: number
395395 }
396396+397397+ /**
398398+ * Specifies an `Object`, or an `Array` of `Object`,
399399+ * which defines aliases used to replace values in `import` or `require` statements.
400400+ * Will be merged with the default aliases inside `resolve.alias`.
401401+ */
402402+ alias?: AliasOptions
396403}
397404398405export interface UserConfig extends InlineConfig {
+4
packages/vitest/src/node/plugins/index.ts
···7575 // by default Vite resolves `module` field, which not always a native ESM module
7676 // setting this option can bypass that and fallback to cjs version
7777 mainFields: [],
7878+ alias: preOptions.alias,
7879 },
7980 server: {
8081 ...preOptions.api,
···100101 const viteConfigTest = (viteConfig.test as any) || {}
101102 if (viteConfigTest.watch === false)
102103 viteConfigTest.run = true
104104+105105+ if ('alias' in viteConfigTest)
106106+ delete viteConfigTest.alias
103107104108 // viteConfig.test is final now, merge it for real
105109 options = deepMerge(