mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
32 lines
580 B
TypeScript
32 lines
580 B
TypeScript
/// <reference types="vitest" />
|
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
{
|
|
name: 'example',
|
|
resolveId(source) {
|
|
if (source === 'virtual-module')
|
|
return source
|
|
},
|
|
load(id) {
|
|
if (id === 'virtual-module') {
|
|
return `
|
|
export const value = 'original';
|
|
`
|
|
}
|
|
},
|
|
},
|
|
],
|
|
test: {
|
|
globals: true,
|
|
environment: 'node',
|
|
deps: {
|
|
external: [/src\/external/],
|
|
interopDefault: true,
|
|
},
|
|
},
|
|
})
|