import type { Plugin } from 'vite'

// https://github.com/antfu/unplugin-auto-import
import AutoImport from 'unplugin-auto-import/vite'

/**
 * unplugin-auto-import
 * @returns Plugin
 */
export function configAutoImportPlugin(): Plugin {
    return AutoImport({
        dts: 'types/auto-imports.d.ts',
        imports: [
            'vue',
            'vue-router',
            {
                '@/config/app': ['$app'],
                '@/api/services': ['defs'],
                '@/api/services/mods': ['API'],
                '@/utils/stomp': [['default', 'Stomp']],
            },
        ],
    })
}
