Skip to content

Add build time hook to extend webmanifest options #224

Description

@igorexa34314

I would like to have a build time hook that will be called before generating webmanifest to override its options. For instance if I want to extend site webmanifest with some values from runtimeConfig or have a more complex configuration (e.g. fetching manifest data from an API).

In result, I will be able to do something like this

nuxt.hooks.hook('pwa:beforeGenerateWebmanifest', async manifest => {
    manifest.name = nuxt.runtimeConfig.public.site.name;
    manifest.lang = nuxt.runtimeConfig.public.i18n.locale;

    // Perform some async operations related to webmanifest setup
    manifest.icons = await generateFavicons();
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions