(spec: string, kind: PluginKind, pkg: PluginPackage)
| 101 | } |
| 102 | |
| 103 | function resolvePackageEntrypoint(spec: string, kind: PluginKind, pkg: PluginPackage) { |
| 104 | const exports = pkg.json.exports |
| 105 | if (isRecord(exports)) { |
| 106 | const raw = extractExportValue(exports[`./${kind}`]) |
| 107 | if (raw) return resolvePackagePath(spec, raw, kind, pkg) |
| 108 | } |
| 109 | |
| 110 | if (kind !== "server") return |
| 111 | const main = packageMain(pkg) |
| 112 | if (!main) return |
| 113 | return resolvePackagePath(spec, main, kind, pkg) |
| 114 | } |
| 115 | |
| 116 | function targetPath(target: string) { |
| 117 | if (target.startsWith("file://")) return fileURLToPath(target) |
no test coverage detected