Open sebaguse opened 4 months ago
A simple solution to solve this would be to break the build-time plugin which transforms the resolveComponent
into an explicit import.
// String() breaks the build-time transform because it's considered dynamic
const imgComponent = useRuntimeConfig().public.mdc.useNuxtImage ? resolveComponent(String('NuxtImg')) : 'img'
But I'm not sure if this will break NuxtImg
being resolved properly, so a solution is a build-time template that returns the image component instance.
I don't have the capacity to investigate further at the moment if anyone else wants to take this up.
any update on this, please?
CC @antfu @farnabaz, any ideas on what to do here? This is proving to be really annoying for DX, and I've got members of my team continuously accidentally installing NuxtImg, even though we don't use it.
I have raised this issue with Nuxt main repo and been adviced this might be a problem with MDC module. The original issue is available here https://github.com/nuxt/nuxt/issues/27854
MDC triggers Nuxt to auto-install NuxtImage despite
useNuxtImage
being set tofalse
. Daniel Roe suggested: