Resolve module path with custom entry point package.json
field relative to caller file.
$ yarn add rsolve
rsolve(id: string, fieldName: string) => Promise<string>
import { rsolve } from 'rsolve'
console.log(
await rsolve('package', 'main')
)
console.log(
await rsolve('@scope/package', 'browser')
)
console.log(
await rsolve('../relative/path/to/package', 'react-native')
)