|
I am creating a nuxt module component library, that will be used in multiple projects, and would therefore really like to have the custom image provider in there. here is the provider from my component-library: And the nuxt.config (partially) from a project that will use it: Any ideas and suggestions are welcome :) |
Replies: 7 comments 3 replies
|
Hey there, what about adding image module to the library module that you have created and register the custom provider there? You can use the utility Example from Nuxt Security: https://github.com/nuxt-modules/security/blob/d46279ae884d5fea4431168a61a112abbd77caea/src/module.ts#L181 |
|
I tried that, but couldn't make it work, but i'll try again and get back :) |
|
I added this to my library module inside module.ts: But it doen't register inside my other project I also tried adding this to the project nuxt.config: |
|
@Baroshem sorry forgot to tag you, while responding to you :) |
|
Hey @momi-aura I have converted this issue into a discussion. Are you having issues with adding a custom module to the main nuxt project or with the fact that the custom provider is not registered properly? Does this custom provider work if you try it in the module playground? Is the module published as an external npm package or is it just local module? |
|
Hey @momi-aura could you share your umbraco-image-provider? Would be great to add to nuxt image. |
@DMOShareIT i have created a draft PR. And will take it out of draft in the coming days. I would however like to first have a stable and proper image source for testing |
Hi @Baroshem
I found a "solution". But forgot to update this :)
I added
addImportsDir(resolve(runtimeDir, 'providers'))to my module.ts. And now i can use the custom provider like this:So it somewhat solves the issue i was having, i would however have prefered if it was possible for me to register the provider inside my module, and then just use it directly inside my other projects :)