Disable PWA plugin in Vue CLI 3
There is an open but accepted proposal to add this to the core functionality: https://github.com/vuejs/vue-cli/issues/3830
EDIT:
Via command line: https://cli.vuejs.org/guide/cli-service.html#skipping-plugins
npx vue-cli-service build --skip-plugins pwa,workbox
Via vue.config.js:
module.exports = {
chainWebpack: config => {
config.plugins.delete('pwa');
config.plugins.delete('workbox');
}
}
Vue enabled a method to disable pwa for certain builds in version 4. Now you can add --skip-plugins pluginname
during your build. This one worked for me just fine:
npx vue-cli-service build --skip-plugins pwa,workbox
Ref: https://cli.vuejs.org/guide/cli-service.html#skipping-plugins
I resolved this by doing the following:
- Removing the
registerServiceWorker.js
file - removing the import of
registerServiceWorker.js
frommain.js
. - removing the
PWA
plugin from thedevDependencies
inpackage.json
.