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

export default defineConfig({
    plugins: [
        laravel({
            input: ['resources/css/app.css', 'resources/js/app.js'],
            refresh: true,
        }),
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,
                },
            },
        }),
        tailwindcss(),
    ],
    server: {
        watch: {
            ignored: ['**/storage/framework/views/**'],
        },
        host: '0.0.0.0',
        port: 5173,
        strictPort: true,
        cors: {
            origin: /^https?:\/\/(.+\.ddev\.site|localhost)(:\d+)?$/,
        },
        hmr: {
            host: 'pp-planer.ddev.site',
            protocol: 'wss',
            clientPort: 5173,
        },
    },
});
