fix: add GlobalComponents dts by BTBMan · Pull Request #469 · unplugin/unplugin-auto-import (original) (raw)

Description

Add an empty GlobalComponents inside declare module 'vue'.

If I have both auto-import.d.ts and components.d.ts files, set vueTemplate: true for auto-import plugin. After that volar can't detect the export GlobalComponents in components.d.ts.

Before this PR, There are two ways to resolve it.

  1. Renaming auto-import.d.ts, make sure this file is after the components.d.ts.
  2. Changing the order of tsconfig.json include field.

I noticed if I add an empty GlobalComponents inside declare module 'vue' can also fix it.

Linked Issues

vuejs/language-tools#3383

Additional context