mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-21 00:35:55 +00:00
fix(nuxt): provide default extensions in resolveTypePath
This commit is contained in:
parent
6fb5c9c151
commit
a0f9ddfe24
@ -8,6 +8,7 @@ export async function resolveTypePath (path: string, subpath: string, searchPath
|
|||||||
const r = resolveModulePath(path, {
|
const r = resolveModulePath(path, {
|
||||||
from: searchPaths?.map(d => directoryToURL(d)),
|
from: searchPaths?.map(d => directoryToURL(d)),
|
||||||
conditions: ['types', 'import', 'require'],
|
conditions: ['types', 'import', 'require'],
|
||||||
|
extensions: ['.js', '.mjs', '.cjs', '.ts', '.mts', '.cts'],
|
||||||
})
|
})
|
||||||
if (subpath) {
|
if (subpath) {
|
||||||
return r.replace(/(?:\.d)?\.[mc]?[jt]s$/, '')
|
return r.replace(/(?:\.d)?\.[mc]?[jt]s$/, '')
|
||||||
|
Loading…
Reference in New Issue
Block a user