You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 to false. Daniel Roe suggested:
The way that code is written means it's possible NuxtImage could be used at runtime so it's not possible to tree shake from the bundle, which is why you are being prompted to install it.
The text was updated successfully, but these errors were encountered:
sebaguse
changed the title
Disable using Nuxt Image functionality
Nuxt Image functionality causes auto-install of NuxtImage module even when NuxtImg is not used
Jul 1, 2024
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 constimgComponent=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.
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:The text was updated successfully, but these errors were encountered: