blob: 6ed3b23d7a3a0d1b8f3877a3c54b9cb214ec4bed (
plain)
1
2
3
4
5
6
7
8
9
10
|
import { createRequire } from "node:module"
import path from "node:path"
export namespace Module {
export function resolve(id: string, dir: string) {
try {
return createRequire(path.join(dir, "package.json")).resolve(id)
} catch {}
}
}
|