2023-05-22 15:46:27 +02:00
|
|
|
import { configDefaults, defineConfig } from 'vitest/config';
|
2023-05-17 21:00:20 +02:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
name: 'resolve-svelte',
|
|
|
|
resolveId(id) {
|
2023-05-22 15:46:27 +02:00
|
|
|
if (id === 'svelte/compiler') {
|
|
|
|
return `${__dirname}/src/compiler/index.js`;
|
|
|
|
}
|
|
|
|
|
2023-05-19 15:59:42 +02:00
|
|
|
if (id === 'svelte') {
|
|
|
|
return `${__dirname}/src/runtime/index.js`;
|
|
|
|
}
|
2023-05-22 15:46:27 +02:00
|
|
|
|
2023-05-19 15:59:42 +02:00
|
|
|
if (id.startsWith('svelte/')) {
|
|
|
|
return id.replace(/^svelte(.*)\/?$/, `${__dirname}/src/runtime/$1/index.js`);
|
2023-05-17 21:00:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
test: {
|
|
|
|
dir: 'test',
|
|
|
|
reporters: ['dot'],
|
2023-05-22 15:46:27 +02:00
|
|
|
exclude: [...configDefaults.exclude, '**/samples/**'],
|
|
|
|
globalSetup: './test/vitest-global-setup.js'
|
2023-05-17 21:00:20 +02:00
|
|
|
}
|
|
|
|
});
|