Skip to content

Provide chunk splitting for shared objects like sidebar and nav #3367

Open
@zhangyx1998

Description

@zhangyx1998

Is your feature request related to a problem? Please describe.

After addressing the problem of memory overflow (issue #3362, pr #3366), I ended up producing a bundle that, although worked fine, turned out to be very large in size. Especially when compared to the original content size.

I investigated the produced html source tree and found each of them contains a copy of their corresponding navbar and sidebar, parsed into html template.

Describe the solution you'd like

Instead of hard-coding the sidebar (and maybe the navbar) as html templates into each entry file, provide a configuration switch to fall back to client side rendering with their data chunked separately as JSON files.

Describe alternatives you've considered

Not applicable

Additional context

To provide an idea of the scale of size, here is a summary of related objects in my project:

File Size Description
nav.json 10KB Serialized nav object
sidebar.json 414KB Serialized sidebar object
cache/ 25MB Cached raw html files before conversion to vitepress
dist/ 1.7GB Bundle produced by vitepress

And here is a link of the deployed site: x.z-yx.cc

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions