wheatjs / vite-plugin-vue-type-imports

Import types in Vue SFC for defineProps
223 stars 16 forks source link

Error when building with vite-plugins-dts #51

Closed ivanmaxlogiudice closed 9 months ago

ivanmaxlogiudice commented 1 year ago

I have some errors when building with type imports

image

Steps to reproduce

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Memory: 4.53 GB / 15.87 GB
  Binaries:
    Node: 18.13.0 - C:\laragon\bin\nodejs\node-v18.13.0-win-x64\node.EXE
    Yarn: 1.22.19 - C:\laragon\bin\yarn\bin\yarn.CMD
    npm: 8.19.3 - C:\laragon\bin\nodejs\node-v18.13.0-win-x64\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (109.0.1518.69)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @types/node: ^18.11.18 => 18.11.18
    @vitejs/plugin-vue: ^4.0.0 => 4.0.0
    class-variance-authority: ^0.4.0 => 0.4.0
    typescript: ^4.9.5 => 4.9.5
    vite: ^4.1.1 => 4.1.1
    vite-plugin-dts: ^1.7.2 => 1.7.2
    vite-plugin-vue-type-imports: ^0.2.4 => 0.2.4
    vue: ^3.2.47 => 3.2.47
    vue-tsc: ^1.0.24 => 1.0.24
selemondev commented 1 year ago

Hey there @ivanmaxlogiudice 👋, I also encountered the same problem but I found some sort of solution for it. You can install the rollup-plugin-typescript2 plugin as shown in the documentation and use it in your vite.config.ts file as shown below :

Check it out here

Let me know if this works for you. Cheers 🥂