You just need to set the
source_path in the
config/webpacker.yml to the directory relative to the
This change is available in Webpacker gem from version 4.1.0 onwards and in Rails from Rails 6.0.1 onwards.
app directory, configure it via the
source_path setting in the
webpacker.yml and that's it.
Once we have configured this directory, then the subsequent Webpacker commands use this directory as reference.
✗ bundle exec rails webpacker:install:react
Copying babel.config.js to app root directory
Copying react example entry file to /Users/prathamesh/Projects/fun/frontend_rails_app/app/frontend/packs
Updating webpack paths to include .jsx file extension