title: How to change webpacker in Rails to watch for changes outside of packs folder?
body: <p>I want hot module reload to reload changes in my JavaScript/React files</p>
  <p>I was going through <a href="https://github.com/rails/webpacker#development" rel="nofollow noreferrer">webpacker development documentation</a></p>
  <p>In that it says</p>
  <blockquote>
  <p>This process will watch for changes in the app/javascript/packs/*.js</p>
  </blockquote>
  <p>Now, I want to watch for changes outside of the packs project as well or in the entire <code>javascript</code> folder and also need to include <code>.jsx</code> file.</p>
  <p>I am not sure how I can do it.</p>
  <p>This is my <code>webpacker</code> file:</p>
  <pre class="lang-ruby prettyprint-override"><code>#!/usr/bin/env ruby
  
  ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] || 'development'
  ENV['NODE_ENV']  ||= 'development'
  
  require 'pathname'
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
                                             Pathname.new(__FILE__).realpath)
  
  require 'bundler/setup'
  
  require 'webpacker'
  require 'webpacker/webpack_runner'
  
  APP_ROOT = File.expand_path('..', __dir__)
  Dir.chdir(APP_ROOT) do
    Webpacker::WebpackRunner.run(ARGV)
  end
  </code></pre>
  <p>And this is my webpacker dev server file</p>
  <pre class="lang-ruby prettyprint-override"><code>#!/usr/bin/env ruby
  
  ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] || 'development'
  ENV['NODE_ENV']  ||= 'development'
  
  require 'pathname'
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
                                             Pathname.new(__FILE__).realpath)
  
  require 'bundler/setup'
  
  require 'webpacker'
  require 'webpacker/dev_server_runner'
  
  APP_ROOT = File.expand_path('..', __dir__)
  Dir.chdir(APP_ROOT) do
    Webpacker::DevServerRunner.run(ARGV)
  end
  </code></pre>