import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import laravel from 'laravel-vite-plugin'
import path from 'path'

export default defineConfig({
    base: '',
    plugins: [
        laravel({
            input: 'resources/js/app.js',
            refresh: true,
        }),
        vue(),
    ],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, 'resources/js'),
            '@views': path.resolve(__dirname, 'app/Views'),
            '@domains': path.resolve(__dirname, 'app/Domains'),
        },
    },
    server: {
        host: true,        // Dev-Server auch über Subdomains erreichbar
        strictPort: true,  // verhindert zufällige Portwechsel
        cors: true,        // erlaubt Dev-HMR über Subdomains
    },
})
