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

export default defineConfig({
    plugins: [vue()],
    build: {
        lib: {
            entry: resolve('src/index.ts'),
            name: 'MintelDirectusToolkit',
            fileName: 'index',
            formats: ['es']
        },
        rollupOptions: {
            external: ['vue', '@directus/extensions-sdk'],
            output: {
                globals: {
                    vue: 'Vue',
                    '@directus/extensions-sdk': 'DirectusExtensionsSDK'
                }
            }
        }
    }
});
