import { loadConfig as loadConfigFn } from 'unconfig' import type { DMConfig } from './type' let tempConfig: Awaited>> | undefined export const loadConfig = async () => { return loadConfigFn({ sources: [ { files: 'dm.config', extensions: ['ts', 'mts', 'cts', 'js', 'mjs', 'cjs', 'json', ''], } ], merge: false, }) } export const getConfig = async () => { if (!tempConfig) { tempConfig = await loadConfig() } return tempConfig }