mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxi): strip extensions from absolute paths (for types) (#4300)
This commit is contained in:
parent
b38dc097f6
commit
eed7036627
@ -43,9 +43,10 @@ export const writeTypes = async (nuxt: Nuxt) => {
|
||||
if (excludedAlias.some(re => re.test(alias))) {
|
||||
continue
|
||||
}
|
||||
const relativePath = isAbsolute(aliases[alias])
|
||||
? relative(nuxt.options.rootDir, aliases[alias]).replace(/(?<=\w)\.\w+$/g, '') /* remove extension */ || '.'
|
||||
: aliases[alias]
|
||||
const path = aliases[alias].replace(/(?<=\w)\.\w+$/g, '') /* remove extension */
|
||||
const relativePath = isAbsolute(path)
|
||||
? relative(nuxt.options.rootDir, path) || '.'
|
||||
: path
|
||||
tsConfig.compilerOptions.paths[alias] = [relativePath]
|
||||
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user