windicss / vite-plugin-windicss

🍃 Windi CSS for Vite ⚡️
MIT License
852 stars 65 forks source link

Add types for virtual:windi-devtools #294

Open kotx opened 2 years ago

kotx commented 2 years ago

Describe the bug

When importing virtual:windi-devtools in TypeScript code, it errors with Cannot find module 'virtual:windi-devtools' or its corresponding type declarations.ts But in the build, there's no error and devtools is loaded normally, since it's just a TypeScript error. Adding // @ts-ignore works as expected.

Minimal Reproductions

I'm following the SvelteKit instructions here https://windicss.org/integrations/vite.html#sveltekit-as-of-1-0-0-next-102 and I added

import { browser } from "$app/env";
if (browser) import("virtual:windi-devtools")

Versions

kotx commented 2 years ago

Unfortunately I just ran into this issue again, still not fixed. Any pointers?