import { fileURLToPath } from 'node:url' import vue from '@vitejs/plugin-vue' import AutoImport from 'unplugin-auto-import/vite' import { defineConfig } from 'vitest/config' // Dedicated Vitest config — intentionally trimmed down from vite.config.ts. // Skip Vuetify / MetaLayouts / VueRouter plugins so unit tests run fast in // happy-dom without loading the full Vuexy bundle. Mirrors apps/portal/vitest.config.ts. export default defineConfig({ plugins: [ vue(), AutoImport({ imports: ['vue', '@vueuse/core'], dirs: ['./src/@core/utils', './src/@core/composable/', './src/composables/', './src/utils/'], vueTemplate: true, // Don't write to auto-imports.d.ts — vite.config.ts owns that file // with the full app's auto-import set. Trimmed test-only set must // not clobber the IDE typings for the running dev server. dts: false, }), ], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), '@core': fileURLToPath(new URL('./src/@core', import.meta.url)), '@layouts': fileURLToPath(new URL('./src/@layouts', import.meta.url)), '@images': fileURLToPath(new URL('./src/assets/images/', import.meta.url)), '@styles': fileURLToPath(new URL('./src/assets/styles/', import.meta.url)), }, }, test: { environment: 'happy-dom', globals: true, include: ['tests/**/*.{test,spec}.ts', 'src/**/__tests__/**/*.{test,spec}.ts'], setupFiles: ['./tests/setup.ts'], }, })