import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import path from 'path'

// Standalone vitest config so the unit runner stays independent of vite.config.js.
// jsdom gives component specs a DOM; the '@' alias mirrors the app build.
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
  test: {
    environment: 'jsdom',
    globals: true,
    // Core specs plus plugin-frontend specs, which the pretest stage copies
    // into src/.plugins-staged/ (under root, so this glob finds them).
    include: ['src/**/*.spec.js'],
  },
})
