Open carlos22 opened 2 weeks ago
This seems to solve it, move the types inside of the export: https://stackoverflow.com/a/77566206
"types": "./dist/typings/tree/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/typings/tree/index.d.ts",
"default": "./dist/vue-virtual-tree.es.js"
},
"require": {
"types": "./dist/typings/tree/index.d.ts",
"default": "./dist/vue-virtual-tree.umd.js"
}
},
"./style.css": "./dist/style.css"
},
But this is still a bit odd when importing VirTree
, maybe you should export VirTree
as default? My IDE has problems to distinguish between the type and the real impl.
Update to v0.0.8 Try it out
this works for the types very good, but now I have:
MyTree.vue:2:10 - error TS1484: 'VirTree' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
not sure how to fix that. It does think VirTree is a type and not a component.
Yes I know, but we use verbatimModuleSyntax
so only type imports will be dropped in the output, and that seems to be not correctly determined.
update to v0.0.9 than can be import like:
Very cool, that seems to work good! Thank you very much.
My type checker says:
I think you need to also export the type files? But not sure why. I use regular npm 10.2.4.