vite-plugin-vue-devtools
vite-plugin-vue-devtools copied to clipboard
DX: The type of the ui-kit component could not be resolved.
I am learning the monorepo architecture of this library.
I found that components in the ui-kit are resolved to any type.
I found that this could be caused by the exports field in ui-kit's package.json (delete this field and add /dist/ in the path in the resolver.ts will work).
I'm still learning and haven't found a solution yet. I've posed an issue(https://github.com/vitejs/vite-plugin-vue/issues/252) for the moment, but wondered if you have an elegant solution?
Commonly we do not care about these, because we use unplugin-vue-components to auto change/add the import path in
compile time.
see this
Commonly we do not care about these, because we use unplugin-vue-components to auto change/add the import path in compile time.
While this generates the type definition file correctly, it doesn't resolve to the vue file correctly. This leads to missing type definitions at development time, even though the components can be imported.
The solution is that the consumer needs to define the paths alias in tsconfig.json.