title: How to disable file watching in a react app
body: <h3>EDIT:</h3>
  <p>My question is now whether it is possible to launch a react app with react-scripts in a production-like environment where I don't necessarily want changes to files to affect the running react server. check below in Solutions section under C for a brief description on what I have already tried.</p>
  <p>I have been struggling with this question for the past two weeks and I am unsure how to proceed. I would like to host my React App on a Node Azure Web App (Linux).</p>
  <h1>The problem I am seeing:</h1>
  <pre><code>Starting the development server...
  
  events.js:170
        throw er; // Unhandled 'error' event
        ^
  
  Error: ENOSPC: System limit for number of file watchers reached, watch 'xxx'
      at FSWatcher.start (internal/fs/watchers.js:165:26)
      at Object.watch (fs.js:1274:11)
      at createFsWatchInstance (/home/u/work/some-repo/node_modules/chokidar/lib/nodefs-handler.js:37:15)
      at setFsWatchListener (/home/u/work/some-repo/node_modules/chokidar/lib/nodefs-handler.js:80:15)
      ...
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! some-repo@0.1.0 start: `react-scripts start`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the some-repo@0.1.0 start script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /home/u/.npm/_logs/2019-08-30T09_50_59_595Z-debug.log
  </code></pre>
  <h1>Solutions attempted:</h1>
  <p>After reading up on this issue online I have understood that the solution might involve</p>
  <p>A: no space on the system. I have checked using <code>df -h</code> and looks like there is plenty of space (at least 50% for my machine).</p>
  <p>B: file watcher limit reached, this seems to be the problem but unfortunately the Azure Web App is a read-only file system, and running something like <code>echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf &amp;&amp; sudo sysctl -p</code> did not help.</p>
  <p>C: Disable watching with React. It doesn't appear that I can do this however, if anyone is aware of how to Disable watching with React it would be very much appreciated. So far I have tried <code>CI=true npm start</code> to no avail (when I ran command and made a change to a file, the change was actively reflected on my browser: <code>localhost:3000</code></p>
  <p>I have also tried adding a multitude of options inside of <code>node_modules/react-scripts/webpack.config.js</code> such as:
  <code>watch: false</code> and <code>ignore:/node_modules/</code>.</p>
  <p>Thanks,
  Nik</p>