Sybrn
Sybrn
NNuxt
Created by brick on 9/17/2024 in #❓・help
Adding Types To Nuxt Module
This is great information! 🙏 Thanks for pointing it out, I had no idea that there was such a difference. It's indeed true that the components and types UI library are/should be available when they are consumed only. I'm going to read up on the explicit relative imports within a runtime directory. And look into the layers. Thanks for pointing me in that direction 😊
14 replies
NNuxt
Created by brick on 9/17/2024 in #❓・help
Adding Types To Nuxt Module
How is it going for you? I'm currently building a module myself and managed to add types with the addImports util with the option type set to true. The types should be imported from a 3rd party package.
names.forEach(name =>
addImports({ name, as: name, from: '@ark-ui/vue', type: true }),
)
names.forEach(name =>
addImports({ name, as: name, from: '@ark-ui/vue', type: true }),
)
And my ts and IDE is happy, but Vue isn't. I get this error: Pre-transform error: [@vue/compiler-sfc] Unresolvable type reference or unsupported built-in utility type I don't understand where it comes from tho. I also tried to add a type template and use a nuxt hook to prepare the types. My repo (pr): https://github.com/carwack/ark-ui-nuxt/pull/1/files
14 replies