Skip to content

Access string from build #8

@gekoke

Description

@gekoke

It would be nice if this library exported a function to build the string in the sitemap file, instead of directly performing the side effect of writing to a file.

Use case: I want to dynamically return the sitemap from an endpoint instead of writing the file at build time. This would let me keep the sitemap up to date when new routes are added e.g. from a CMS, without rebuilding and redeploying.

Separating the string generation and writing to file is generally a good idea and means the string generation could be composed with other use cases - not just mine - as well.

Perhaps exporting a function like this is out of scope for a Vite plugin, however? I understand that a Vite plugin is really only expected to perform file transformations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions