Open stefanobartoletti opened 3 months ago
After updating to version v0.9.0
, this problem has been mitigated, I think by implementing some dynamic import from #253
As you can see, now the bundle is significantly lighter than before.
@farnabaz I'm not sure if the changes incorporated from this PR can also be applied to the remaining dependencies (probably not), but maybe this is a first step into making this package of a decent size for production environments.
Thanks for your work!
Just like the title says, please provide a
server-only
mode that will not include all dependencies in the client-side bundles.The use-case scenario is like that:
nuxt/mdc
is used to process it and transform to a valid HTML.nuxt/mdc
is no longer used.Currently, a lot of heavy dependencies are still included in the final client bundles, like
shiki
and all its code syntax definitions and sub-deps,emojilib
(see #187), and possibly other.Some client-size bundle analysis by running
nuxi analyze
without MDC dependencies:And with MDC included:
As you can see, the final global size is more than doubled, and all that code is never used again after the fetch & transform from the CMS (also note that this specific project is already quite heavy as it packs some animation and 3D libraries, in a more standard project the ratio between MDC code and other would be even more unbalanced)
There is an old comment where a possible addition of
server-only
andclient-only
modes was mentioned (https://github.com/nuxt-modules/mdc/issues/135#issuecomment-1927051823 ), is this still a planned feature?