mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
fix(nuxi): only strip extensions from files (#22399)
This commit is contained in:
parent
c044d0eef5
commit
8166fb20a5
@ -73,10 +73,14 @@ export const writeTypes = async (nuxt: Nuxt) => {
|
||||
tsConfig.include.push(`${absolutePath}/*`)
|
||||
}
|
||||
} else {
|
||||
tsConfig.compilerOptions.paths[alias] = [absolutePath.replace(/(?<=\w)\.\w+$/g, '')] /* remove extension */
|
||||
const path = stats?.isFile()
|
||||
? absolutePath.replace(/(?<=\w)\.\w+$/g, '') /* remove extension */
|
||||
: absolutePath
|
||||
|
||||
tsConfig.compilerOptions.paths[alias] = [path]
|
||||
|
||||
if (!absolutePath.startsWith(rootDirWithSlash)) {
|
||||
tsConfig.include.push(absolutePath.replace(/(?<=\w)\.\w+$/g, ''))
|
||||
tsConfig.include.push(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user