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

export default defineConfig({
    plugins: [
        tailwindcss(),
        laravel({
            input: ['resources/js/app.js'],
            refresh: [
                'resources/views/**/*.blade.php',
                'resources/css/**/*.css',
                'resources/js/**/*.js',
                'app/Livewire/**/*.php',
                'lang/**/*.php',
            ],
        }),
    ],
    optimizeDeps: {
        include: [
            'axios',
            'laravel-echo',
            'pusher-js',
            'chart.js',
            'chart.js/auto',
        ],
        force: true,
    },
    server: {
        host: '0.0.0.0',
        port: 5173,
        strictPort: true,
        cors: true,
        origin: 'https://app.nimuli.com',
        hmr: {
            host: 'app.nimuli.com',
            clientPort: 443,
            protocol: 'wss',
            path: '/vite-hmr',
        },
        allowedHosts: ['app.nimuli.com', 'localhost', '10.10.90.142'],
    },
});
