import { defineConfig } from 'vite'
import preact from '@preact/preset-vite'

export default defineConfig({
    plugins: [
        preact({
            prerender: {
                enabled: true,
                renderTarget: '#app',
                additionalPrerenderRoutes: ['/404'],
                previewMiddlewareEnabled: true,
                previewMiddlewareFallback: '/404',
            },
        }),
    ],
    server: {
        host: '0.0.0.0',
        port: 8080
    },
    preview: {
        host: '0.0.0.0',
        port: 8080
    },
    build: {
        outDir: 'dist',
        assetsDir: 'assets'
    }
})
