| ... | @@ -251,9 +251,10 @@ function getPackageRoot(absPath: string) { | ... | @@ -251,9 +251,10 @@ function getPackageRoot(absPath: string) { |
| 251 | const process = globalThis.process; | 251 | const process = globalThis.process; |
| 252 | if (!fs || !path || !process) return null; | 252 | if (!fs || !path || !process) return null; |
| 253 | | 253 | |
| | 254 | const isNodeBuiltin = absPath.startsWith("node:"); |
| 254 | if ( | 255 | if ( |
| 255 | "Bun" in globalThis && | 256 | "Bun" in globalThis && |
| 256 | (absPath.startsWith("node:") || absPath.startsWith("internal:")) | 257 | (isNodeBuiltin || absPath.startsWith("internal:")) |
| 257 | ) { | 258 | ) { |
| 258 | return [ | 259 | return [ |
| 259 | `https://github.com/oven-sh/bun/blob/bun-v${process.versions.bun}/src/js/`, | 260 | `https://github.com/oven-sh/bun/blob/bun-v${process.versions.bun}/src/js/`, |
| ... | @@ -261,7 +262,14 @@ function getPackageRoot(absPath: string) { | ... | @@ -261,7 +262,14 @@ function getPackageRoot(absPath: string) { |
| 261 | absPath.replace(":", "/") + ".ts", | 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 | return [ | 273 | return [ |
| 266 | `https://github.com/nodejs/node/blob/${process.version}/lib/`, | 274 | `https://github.com/nodejs/node/blob/${process.version}/lib/`, |
| 267 | "", | 275 | "", |