stereobooster / react-snap

👻 Zero-configuration framework-agnostic static prerendering for SPAs
MIT License
5.04k stars 391 forks source link

Ways to configure pre-rendered routes #470

Open OlyAney opened 4 years ago

OlyAney commented 4 years ago

Is there other way to configure routes that'll be pre-rendered other than package.json? I want to pre-render the routes that come from CMS and I'm getting these routes on build time

jun-gh commented 4 years ago

Did you find solution for this?

OlyAney commented 4 years ago

Did you find solution for this?

@jun-gh the way I've done this is I've created a script that does this:

  1. Fetch paths from the CMS
  2. Append these paths into reactSnap: { includes: [...] } config in package.json
  3. Run prettier so that package.json is beautiful once again

I run this script before react-snap is ran (which is postbuild) + on a pre-push hook to keep package.json up to date Hope this helps!