mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +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))) {
|
if (excludedAlias.some(re => re.test(alias))) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
const relativePath = isAbsolute(aliases[alias])
|
const path = aliases[alias].replace(/(?<=\w)\.\w+$/g, '') /* remove extension */
|
||||||
? relative(nuxt.options.rootDir, aliases[alias]).replace(/(?<=\w)\.\w+$/g, '') /* remove extension */ || '.'
|
const relativePath = isAbsolute(path)
|
||||||
: aliases[alias]
|
? relative(nuxt.options.rootDir, path) || '.'
|
||||||
|
: path
|
||||||
tsConfig.compilerOptions.paths[alias] = [relativePath]
|
tsConfig.compilerOptions.paths[alias] = [relativePath]
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user