Trigger declaration generation in vite build watch mode when non-ts file changes #335
Open
2 tasks done
Labels
enhancement
New feature or request
Description
At the moment, when Vite build watch mode is enabled, declarations get generated only when typescript files are modiefied.
I think the declarations should be generated on every change or we should be able to specify which file types trigger the generation.
My use case is that I have a library that has React components and CSS files. When I'm using the watch mode and modify a typescript file, everything works as expected. But when I modify a CSS file, vite triggers a build, which by default empties the out dir first getting rid of the declarations.
Using
emptyOutDir
would be a way around this, but it has other problems. And even if it worked as its supposed to work, it might have other side effects in different kinds of configurations.Suggested solution
I'm suggesting that in watch mode, the declarations would get generated on every builld, not just when typescript files changes.
Alternative
Alternatively (or in addition), a config option for file extensions (or globs) that trigger the generation would be a viable solution.
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: