import adapter from 'svelte-adapter-bun';
import { mdsvex } from 'mdsvex';

/** @type {import('@sveltejs/kit').Config} */
const config = {
    extensions: ['.svelte', '.md'],
    preprocess: [
        mdsvex({
            extensions: ['.md']
        })
    ],
    kit: {
        adapter: adapter(),

        csp: {
            mode: 'auto',
            directives: {
                'default-src': ['self'],
                'base-uri': ['self'],
                'object-src': ['none'],
                'frame-ancestors': ['none'],
                'form-action': ['self'],

                'script-src': [
                    'self'
                ],

                'frame-src': [
                    'self'
                ],

                'connect-src': [
                    'self',
                    'http://localhost:3000',
                    'https://cms.donauschwaben.online'
                ],

                'style-src': ['self'],
                'img-src': [
                    'self',
                    'data:',
                    'http://localhost:3000',
                    'https://cms.donauschwaben.online'
                ],
                'font-src': ['self']
            }
        }
    }
}

export default config;