unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.76k stars 349 forks source link

dts entries are pruned too easily (Vite) #380

Open moeriki opened 2 years ago

moeriki commented 2 years ago

vite: 2.9.6 vitest 0.10.0 unplugin-vue-components: 0.19.3

Whenever running vite dev or vitest the plugin removes the components it hasn't "seen" yet from the dts. This behavior makes sense (something something how Vite works?) but gives us quite some overhead in having to discard these changes in our version control pretty much constantly when changing branches, rebasing, etc… while running tests in between.

Additionally the resulting git diff messes with the turborepo cache, triggering unnecessary work to happen eg. when our build runs after our tests.

Does anyone have a good way to go about this?

Would it make sense to add an option to prune only on build, where we are sure the output is exactly right?

A downside would be that there might be "dead" entries when we don't do a build. This will happen way less frequently than the current issue, and I have noticed those "dead" entries don't really break anything in our setup.

wiidede commented 1 year ago

@lishaobos

https://github.com/antfu/unplugin-auto-import/issues/267#issuecomment-1437781699

Hello. If possible, could you synchronize the cache feature to here? It's easier to have the problem of deleting many lines here.