I am looking at doing some prerendering or SSR with Vue and think it would be great to see it as an option in this template or create a similar template like webpack-advanced
I did see this project. https://github.com/chrisvfritz/prerender-spa-plugin-vue-demo and I am going to try and get it to work with this template, however, I haven't been able to find a template similar to the vue-hackernews that supports SSR and all the CSS loaders this template supports.
I know there are other examples out there, but it's a good feeling having confidence in the starting template. I have been very happy and comfortable with this base template, but I am not sure the best path to adding SSR or Prerendering efficiently.
@MatthewOverall Docs have just been updated for using prerender-spa-plugin with this template. That one should now be a very simple integration.
SSR, on the other hand, is a bit more complex and will be highly dependent on what you're using for the backend. If you want to build something with SSR, I'd first ask, "Do you really need it?" If you just need to prerender some marketing pages, stick with prerender-spa-plugin. And even if you need dynamic prerendering for a content-driven site, I would personally prefer to use Prerender.io or Netlify's dynamic prerendering before reaching for SSR, as they'll be much less complex.
In cases where it's important that prerendered pages always render the very most up-to-date data, I think it's likely it shouldn't be a SPA in the first place. If you're sure it should be a SPA and only SSR will do, then I'd use the hackernews project as a template, simply deleting anything hackernews-specific. Then you can selectively copy over whatever you need from this build. I know it's not ideal and we do want to improve the friendliness of SSR in the future, but that's where we currently stand.
@chrisvfritz Thanks for pointing me in the right direction. Since this template doesn't have vue-router built in I was able to follow your other example and get it all put together. I agree SSR is certainly not needed for the project I am working on so prerendering is great. Thanks for your help and contributions!
Most helpful comment
@MatthewOverall Docs have just been updated for using
prerender-spa-pluginwith this template. That one should now be a very simple integration.SSR, on the other hand, is a bit more complex and will be highly dependent on what you're using for the backend. If you want to build something with SSR, I'd first ask, "Do you really need it?" If you just need to prerender some marketing pages, stick with
prerender-spa-plugin. And even if you need dynamic prerendering for a content-driven site, I would personally prefer to use Prerender.io or Netlify's dynamic prerendering before reaching for SSR, as they'll be much less complex.In cases where it's important that prerendered pages always render the very most up-to-date data, I think it's likely it shouldn't be a SPA in the first place. If you're sure it should be a SPA and only SSR will do, then I'd use the hackernews project as a template, simply deleting anything hackernews-specific. Then you can selectively copy over whatever you need from this build. I know it's not ideal and we do want to improve the friendliness of SSR in the future, but that's where we currently stand.