Do you know how we can use the vite build --watch and somehow get the type declaration files copied? I can use "concurrently", but that seems heavy handed.
I'm also having this problem after following this great article, I guess that the other option would be to run vite build --watch without the type declaration, which is a lot faster, and completely disregard the import error in your application. I added myself a separate script ("build:types": "vue-tsc --emitDeclarationOnly") for creating the type after the build watch started, so this way it removes the import warning and I can still develop, but like I said earlier even with the warnings you can still develop and once you're done with the component then run a full build components and you will get all types back. Another option could be to use vite-plugin-dts but I had issues with it, it is however much faster than vue-tsc
Also note that you probably don't need the mv command (which is not cross platform, at least it doesn't work on Windows), you can simply add this tsconfig "declarationDir": "dist"
I would suggest just developing the components regularly without a watcher, once you are finished you can check the actual build output, but it shouldn't ever be different than the local one.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Do you know how we can use the
vite build --watch
and somehow get the type declaration files copied? I can use "concurrently", but that seems heavy handed.I'm also having this problem after following this great article, I guess that the other option would be to run
vite build --watch
without the type declaration, which is a lot faster, and completely disregard the import error in your application. I added myself a separate script ("build:types": "vue-tsc --emitDeclarationOnly"
) for creating the type after the build watch started, so this way it removes the import warning and I can still develop, but like I said earlier even with the warnings you can still develop and once you're done with the component then run a full build components and you will get all types back. Another option could be to use vite-plugin-dts but I had issues with it, it is however much faster thanvue-tsc
Also note that you probably don't need the
mv
command (which is not cross platform, at least it doesn't work on Windows), you can simply add this tsconfig"declarationDir": "dist"
I would suggest just developing the components regularly without a watcher, once you are finished you can check the actual build output, but it shouldn't ever be different than the local one.