Description
Is your feature request related to a problem? Please describe.
I'm currently working on a solution to create a vitepress site from a CMS, which contains quite a few pages. We are using dynamic routes to fetch the existing data and are essentially using one template and one path loader, as we cannot determine previously how the site is structured and generate the appropriate path loader for each part of the site. However, because we need to load all the content into memory to return the list in the paths loader, we are reaching very high memory usage which we would like to mitigate to avoid future problems as the content in the CMS will grow.
Describe the solution you'd like
The solution I'm proposing is to allow content
in the return of paths()
to be provided as a function (possibly an async one) , so that the content can be loaded as each page is generated and not previously, thus avoiding the memory overload.
Describe alternatives you've considered
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the docs.
- Read the Contributing Guidelines.
- Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.