title: Ignoring certain Url path-names in Service Worker for Create React App
body: <p>the url that is ignored by default in Create React App Service Worker is the following for firebase auth <code>"__"</code> urls, it is done like so: </p>
  
  <p><code>navigateFallbackWhitelist: [/^(?!\/__).*/]</code></p>
  
  <p>**using the same negative Regex method I tried adding to the array the following, <code>"/dynamicHosting"</code>: **</p>
  
  <p>Like so:</p>
  
  <p><code>navigateFallbackWhitelist: [/^(?!\/__).*/, /^(?!\/dynamicHosting).*/]</code>**</p>
  
  <blockquote>
    <p>Problem is that Service Worker still keeps intercepting the path
    <code>"/dynamicHosting"</code> </p>
  </blockquote>
  
  <p>Thus the <code>200.html</code> my default navigateFallback file renders. instead of dynamic html file from my server.</p>
  
  <p>Why is the ServiceWorker not ignoring the path <code>"/dynamicHosting"</code>.   </p>
  
  <p>I am using SW-Precache CLI like so without ejecting from Create React App:</p>
  
  <pre><code>"build": "react-scripts build &amp;&amp; sw-precache --config=sw-precache-config.js
  </code></pre>
  
  <p>Where the sw-precache-config.js looks like so:</p>
  
  <pre><code>module.exports = {
    staticFileGlobs: [
      './build/**/**.html',
      './build/images/**',
      './build/static/**',
      './build/manifest.json',
    ],
    dontCacheBustUrlsMatching: /\.\w{8}\./,
    swFilePath: './build/service-worker.js',
        // For unknown URLs, fallback to the index page
    navigateFallback: './200.html',
        // Ignores URLs starting from /__ (useful for Firebase):
    navigateFallbackWhitelist: [/^(?!\/__).*/, /^(?!\/dynamicHosting).*/],
    staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/, /404\.html$/],
    stripPrefix: './build'
  }
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>instead of a comma I had to write up the navigateFallbackWhitelist like so to combine the Regex: </p>
  
  <p>after the following change it works: </p>
  
  <p><code>navigateFallbackWhitelist: [/^(?!\/__).*/+ "|" +/^(?!\/dynamicHosting).*/],</code></p>