import { resolve , requireDefault , importPath , resolveESM } from "@kosko/require" ; import debug from "./debug" ; export async function localRequireDefault ( id , cwd ) { const path = await resolve ( id , { baseDir : cwd } ) ; debug ( "Importing %s from %s" , id , path ) ; return requireDefault ( path ) ; } export async function localImportDefault ( id , cwd ) { const path = await resolveESM ( id , { baseDir : cwd } ) ; debug ( "Importing %s from %s" , id , path ) ; const mod = await importPath ( path ) ; return mod . default ; }