question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow users to disable web app manifest injection in PWA plugin

See original GitHub issue

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...
    }
  }
}

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
matrunchykcommented, Sep 1, 2020

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.

7reactions
LinusBorgcommented, Oct 8, 2019
chainWebpack: config => config.plugins.delete('pwa')

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced settings and customizations - OutSystems 11 ...
The manifest in LifeTime overrides the PWA settings in the current environment only. Sample PWA manifest. You can use Web App Manifest Generator ......
Read more >
plugin-pwa | Docusaurus
App installation requires the HTTPS protocol and a valid manifest. Offline mode (precaching)​. We enable users to browse a Docusaurus site ...
Read more >
Web app manifest
Each PWA should include a single manifest per application, typically hosted in the root folder, and linked on all HTML pages your PWA...
Read more >
Way To Inject Javascript in PWA on Non-PWA Pages?
If I make a Progressive Web App (PWA), and I change the display in the manifest.json file to browser instead of the typical...
Read more >
App capability declarations - UWP applications | Microsoft Learn
Capabilities must be declared in your Windows app's package manifest to access certain API or resources like pictures, music, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found