mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 09:25:54 +00:00
fix(bridge): exclude bridge alias types to support Volar (#2013)
This commit is contained in:
parent
b660ac0900
commit
1e0e8818da
@ -39,7 +39,13 @@ export const writeTypes = async (nuxt: Nuxt) => {
|
|||||||
'#assets': '@nuxt/nitro'
|
'#assets': '@nuxt/nitro'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exclude bridge alias types to support Volar
|
||||||
|
const excludedAlias = [/^@vue\/.*$/]
|
||||||
|
|
||||||
for (const alias in aliases) {
|
for (const alias in aliases) {
|
||||||
|
if (excludedAlias.some(re => re.test(alias))) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
const relativePath = relative(nuxt.options.rootDir, aliases[alias]).replace(/(?<=\w)\.\w+$/g, '') /* remove extension */ || '.'
|
const relativePath = relative(nuxt.options.rootDir, aliases[alias]).replace(/(?<=\w)\.\w+$/g, '') /* remove extension */ || '.'
|
||||||
tsConfig.compilerOptions.paths[alias] = [relativePath]
|
tsConfig.compilerOptions.paths[alias] = [relativePath]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user