fix(nuxt): provide default extensions in resolveTypePath

This commit is contained in:
Daniel Roe 2025-03-02 21:48:51 +00:00
parent 6fb5c9c151
commit a0f9ddfe24
No known key found for this signature in database
GPG Key ID: CBC814C393D93268

View File

@ -8,6 +8,7 @@ export async function resolveTypePath (path: string, subpath: string, searchPath
const r = resolveModulePath(path, {
from: searchPaths?.map(d => directoryToURL(d)),
conditions: ['types', 'import', 'require'],
extensions: ['.js', '.mjs', '.cjs', '.ts', '.mts', '.cts'],
})
if (subpath) {
return r.replace(/(?:\.d)?\.[mc]?[jt]s$/, '')