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
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:
The context is a SSG Nuxt site, with content fetched from a headless CMS
MD content is fetched from the CMS, nuxt/mdc is used to process it and transform to a valid HTML.
Once source markdown content has been processed, 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 and client-only modes was mentioned (#135 (comment) ), is this still a planned feature?
The text was updated successfully, but these errors were encountered:
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.
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 (#135 (comment) ), is this still a planned feature?The text was updated successfully, but these errors were encountered: