fix: gen-component-declaration (#2267)

This commit is contained in:
Yugang Cao 2022-01-25 12:43:42 +08:00 committed by GitHub
parent faed3b7955
commit a684528062
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -65,7 +65,7 @@ app.use(naive)
### Volar 支持2.24.2
如果你在使用 Volar那么可以在 `tsconfig.json` 中配置 `compilerOptions.types` 来指定全局组件类型。
如果你在使用 Volar那么可以在 `tsconfig.json` 中配置 `compilerOptions.types` 来指定全局组件类型。
```json
// tsconfig.json

View File

@ -27,8 +27,8 @@ async function generateComponentsType () {
components[key] = entry
}
})
const originalContent = exist(resolve(TYPE_ROOT, 'components.d.ts'))
? await fs.readFile(resolve(TYPE_ROOT, 'components.d.ts'), 'utf-8')
const originalContent = exist(resolve(TYPE_ROOT, 'volar.d.ts'))
? await fs.readFile(resolve(TYPE_ROOT, 'volar.d.ts'), 'utf-8')
: ''
const originImports = parseComponentsDeclaration(originalContent)