Skip to content

Allow users to disable web app manifest injection in PWA plugin #4653

@kmohrf

Description

@kmohrf

What problem does this feature solve?

I’m currently implementing an app for community radios called thekno. This app should only have one build so that other radios can use it as-is and is configurable via a JSON file that is loaded at runtime and contains data on the primary API endpoint, livestream and trackservice endpoints, social profiles, and so forth.

I’d like to include the possibility to add a PWA configuration in this file, similar but not necessarily the same as the PWA plugin configuration that includes information on theme color, icons, etc. But right now the PWA plugin injects a manifest on its own which I have to configure up-front at build time. I’d like to keep all the service worker logic that the PWA plugin manages for me but disable the default web app manifest. That way the PWA plugin would take care of any service worker related tasks but allows me to inject a web app manifest at runtime.

What does the proposed API look like?

I‘d like to introduce a boolean field called disableWebAppManifestInjection that controls web app manifest injection at build time. Any other name for this field is fine with me.

// Inside vue.config.js
module.exports = {
  // ...other vue-cli plugin options...
  pwa: {
    disableWebAppManifestInjection: true,
 
    // configure the workbox plugin
    workboxPluginMode: 'InjectManifest',
    workboxOptions: {
      // swSrc is required in InjectManifest mode.
      swSrc: 'dev/sw.js',
      // ...other Workbox options...
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions