Allow users to disable web app manifest injection in PWA plugin
See original GitHub issueWhat 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...
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:9 (3 by maintainers)
I still need a PWA plugin, but don’t want manifest.json to be injected (I create & inject it manually). So this flag would be a nice solution for my case.
You might be interested in learning about the
inspect
command which will allow you to inspect the current webpack config, find which plugins etc it uses and then manipulate those with the chainWebpack API.