(originalPath: string, fileName: string)
| 648 | |
| 649 | // Map a graph id (possibly a .vue source path) to actual import spec |
| 650 | export function addSfcMapping(originalPath: string, fileName: string) { |
| 651 | try { |
| 652 | if (!originalPath || !fileName) return; |
| 653 | const base = originalPath.split('?')[0]; |
| 654 | const norm = normalizeSpec(base); |
| 655 | // Also derive a relative variant if under app root to handle lookups that slice to that portion |
| 656 | let rel = norm; |
| 657 | const srcIdx = norm.indexOf(APP_VIRTUAL_WITH_SLASH); |
| 658 | if (srcIdx !== -1) rel = norm.slice(srcIdx); |
| 659 | sfcArtifactMap.set(norm, fileName); |
| 660 | if (rel !== norm) sfcArtifactMap.set(rel, fileName); |
| 661 | } catch {} |
| 662 | } |
| 663 | |
| 664 | // Build explicit SFC variant URL (script/template). Always preserves the variant query. |
| 665 | function resolveSfcVariantSpec(id: string, type: 'script' | 'template', cacheBustTag?: string): string { |
no test coverage detected