Skip to content

Support for vue router data loaders #450

@husayt

Description

@husayt

Clear and concise description of the problem

Vue Router Data loaders allow to start loading page data as early as possible and a great way to speed up page loading.

https://uvr.esm.is/data-loaders/

As you can see from this example they need to be registered before router. How can we do that with Vite SSG, as viteSSG createsApp and registers router itself?

const app = createApp({})
// Register the plugin before the router
app.use(DataLoaderPlugin, { router }) 
// adding the router will trigger the initial navigation
app.use(router)

Suggested solution

Allow for a code to be added in between or to have option to register loaders.

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions