SolarLiner / vue-cli-plugin-prerender-spa

Boost SEO by prerendering your Vue application. Powered by prerender-spa-plugin.
https://www.npmjs.com/package/vue-cli-plugin-prerender-spa
MIT License
174 stars 26 forks source link

index.html precache-manifest version not changing (vue cli pwa) #43

Open jaunt opened 5 years ago

jaunt commented 5 years ago

I'm using the plugin with "/" as one of my pre rendered routes. This of course generates an app.html since index.html becomes the pre-rendered version.

I'm also using the Vue CLI 3 PWA plugin in InjectManifest mode. What happens, is that the build process creates the precache-manifest.xxxxx.js file, and has both the app.html and index.html file, but index.html revision never changes, so my service worker gets confused once deployed as the new index.html file isn't loaded on an update. App.html seems to get a new version which is good.

I wonder if it has to do with order of operations. I.e. when does vue-cli-plugin-prerender-spa create app.html, and then I guess overwrite the index.html file generated by webpack build? I'm guessing that the workbox plugin which hashes the files to create the revision strings in precache-manifest.xxxxx.js is doing it an an inopportune time.

Thoughts?

Thanks!

jaunt commented 5 years ago

My solution is here, but I've since abandoned pre-rendering altogether. I believe my app isn't well suited to it. https://gist.github.com/jaunt/b5127af103995e80dd74ff14662a0281