unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue

Home Page:https://www.npmjs.com/package/unplugin-vue-components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dts entries are pruned too easily (Vite)

moeriki opened this issue · comments

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.

@lishaobos

unplugin/unplugin-auto-import#267 (comment)

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