(spec: string)
| 1880 | |
| 1881 | // Helper to resolve .vue file imports to absolute project paths |
| 1882 | const resolveVueKey = (spec: string): string | null => { |
| 1883 | if (!spec || typeof spec !== 'string') { |
| 1884 | return null; |
| 1885 | } |
| 1886 | |
| 1887 | // Only process .vue files |
| 1888 | if (!PAT.VUE_FILE_PATTERN.test(spec)) { |
| 1889 | return null; |
| 1890 | } |
| 1891 | |
| 1892 | let key: string; |
| 1893 | if (spec.startsWith('/')) { |
| 1894 | key = spec; |
| 1895 | } else if (spec.startsWith('./') || spec.startsWith('../')) { |
| 1896 | key = path.posix.normalize(path.posix.join(importerDir, spec)); |
| 1897 | if (!key.startsWith('/')) key = '/' + key; |
| 1898 | } else { |
| 1899 | return null; |
| 1900 | } |
| 1901 | |
| 1902 | // Strip query params |
| 1903 | key = key.replace(PAT.QUERY_PATTERN, ''); |
| 1904 | return key; |
| 1905 | }; |
| 1906 | |
| 1907 | // Replacement function for all imports |
| 1908 | const replaceVueImport = (_match: string, prefix: string, spec: string, suffix: string): string => { |
no test coverage detected