natahouse / react-snap

nata.house's fork of @stereobooster's react-snap:👻 Zero-configuration framework-agnostic static prerendering for SPAs
MIT License
32 stars 6 forks source link

Exclude routes #1

Closed philipeatela closed 4 years ago

philipeatela commented 4 years ago

Add configuration option to prevent certain routes from being crawled.

References: https://github.com/stereobooster/react-snap/issues/362, https://github.com/stereobooster/react-snap/pull/165

Valerika commented 3 years ago

Hi @HigorAlves @philipeatela! Exclude not worked for me.

My settings for react-snap:

"reactSnap": {
    "source": "www",
    "puppeteerArgs": [
      "--no-sandbox",
      "--disable-setuid-sandbox",
      "--unlimited-storage",
      "--full-memory-crash-report",
      "--disable-dev-shm-usage",
      "--disable-gpu",
      "--headless",
      "--disable-extensions"
    ],
    "skipThirdPartyRequests": true,
    "enableLogging": true,
    "removeScriptTags": true,
    "exclude": [
      "/funds/*",
      "/referral"
    ]
  }
xavierraffin commented 3 years ago

@Valerika This is probably because you are not using the master branch of this fork.

If you install it like that it will work:

npm install --save-dev https://github.com/natahouse/react-snap/tarball/master

But this is not ideal you can +1 this: https://github.com/natahouse/react-snap/issues/26

Valerika commented 3 years ago

@xavierraffin thanks!

Have you encountered the issue of scripts with chunks in static html files? When deploying, I have a problem, because the html file refers to the previous script with a chunk hash. The problem is solved by clearing the cache.