[Vuejs]-How to generate new revision each build in vuejs?

0👍

You may need workbox@v5 to modify the manifest.

Assuming using yarn, add resolutions field in package.json:

"resolutions": {                      
  "@vue/cli-plugin-pwa/workbox-webpack-plugin": "^5.0.0"
},

Then run yarn to install. And in your vue.config.js:

module.exports = {                    
  pwa: {                                
    workboxOptions: {                     
      exclude: ['index.html'],            
      additionalManifestEntries:[           
        { url: '/index.html',revision: Date.now().toString() }
      ]
    } 
  }                                 
}

See also:


If you don’t like workbox@v5, apparently you can modify precache manifest after build 🙂

Leave a comment