import { resolveFrom } from './resolveFrom' ; export function tryImportFrom < T > ( packageName , dir ) { try { const path = resolveFrom ( packageName , dir ) ; if ( ! path ) { return undefined ; } return require ( path ) ; } catch ( error ) { return undefined ; } }