| ... | ... | @@ -251,9 +251,10 @@ function getPackageRoot(absPath: string) { |
| 251 | 251 | const process = globalThis.process; |
| 252 | 252 | if (!fs || !path || !process) return null; |
| 253 | 253 | |
| 254 | const isNodeBuiltin = absPath.startsWith("node:"); |
| 254 | 255 | if ( |
| 255 | 256 | "Bun" in globalThis && |
| 256 | | (absPath.startsWith("node:") || absPath.startsWith("internal:")) |
| 257 | (isNodeBuiltin || absPath.startsWith("internal:")) |
| 257 | 258 | ) { |
| 258 | 259 | return [ |
| 259 | 260 | `https://github.com/oven-sh/bun/blob/bun-v${process.versions.bun}/src/js/`, |
| ... | ... | @@ -261,7 +262,14 @@ function getPackageRoot(absPath: string) { |
| 261 | 262 | absPath.replace(":", "/") + ".ts", |
| 262 | 263 | ]; |
| 263 | 264 | } |
| 264 | | if (absPath.startsWith("node:")) { |
| 265 | if (isNodeBuiltin) { |
| 266 | if ("Deno" in globalThis) { |
| 267 | return [ |
| 268 | `https://github.com/denoland/deno/blob/v${process.versions.deno}/ext/node/polyfills/`, |
| 269 | "", |
| 270 | absPath.slice(5) + ".js", |
| 271 | ]; |
| 272 | } |
| 265 | 273 | return [ |
| 266 | 274 | `https://github.com/nodejs/node/blob/${process.version}/lib/`, |
| 267 | 275 | "", |