* Strip bundler URL prefixes from a raw source path.
(rawPath: string)
| 532 | * Strip bundler URL prefixes from a raw source path. |
| 533 | */ |
| 534 | function cleanSourcePath(rawPath: string): string { |
| 535 | let path = rawPath; |
| 536 | |
| 537 | // 1. Strip query params and hashes |
| 538 | path = path.replace(/[?#].*$/, ""); |
| 539 | |
| 540 | // 2. Turbopack project prefix |
| 541 | path = path.replace(/^turbopack:\/\/\/\[project\]\//, ""); |
| 542 | |
| 543 | // 3. webpack-internal |
| 544 | path = path.replace(/^webpack-internal:\/\/\/\.\//, ""); |
| 545 | path = path.replace(/^webpack-internal:\/\/\//, ""); |
| 546 | |
| 547 | // 4. webpack |
| 548 | path = path.replace(/^webpack:\/\/\/\.\//, ""); |
| 549 | path = path.replace(/^webpack:\/\/\//, ""); |
| 550 | |
| 551 | // 5. turbopack generic |
| 552 | path = path.replace(/^turbopack:\/\/\//, ""); |
| 553 | |
| 554 | // 6. http(s)://host:port/ |
| 555 | path = path.replace(/^https?:\/\/[^/]+\//, ""); |
| 556 | |
| 557 | // 7. file:/// |
| 558 | path = path.replace(/^file:\/\/\//, "/"); |
| 559 | |
| 560 | // 8. Webpack chunk group prefixes like (app-pages-browser)/./ |
| 561 | path = path.replace(/^\([^)]+\)\/\.\//, ""); |
| 562 | |
| 563 | // 9. Leading ./ |
| 564 | path = path.replace(/^\.\//, ""); |
| 565 | |
| 566 | return path; |
| 567 | } |
| 568 | |
| 569 | /** |
| 570 | * Probe a single fiber's component function by invoking it with a |
no outgoing calls
no test coverage detected
searching dependent graphs…