I\'m a bit stumped. My local rails app works great with webpacker 4.2 and react, but when deploying to production gives me the wonderful can\'t find application in /ap
If you are using Rails 6+ with webpacker then due to the latest rails 6 update the both javascript and css files are moved under app/javascript instead of app/assets.
app/javascript:
├── packs:
│ # only webpack entry files here
│ └── application.js
└── src:
│ └── application.css
└── images:
└── logo.svg
But if you have upgraded from older version to new version but still want to compile CSS from app/assets/stylesheets folder then follow the below tweaks:
config/webpacker.yml for webpack to include app/assets in the resolved path.// config/webpacker.yml
resolved_paths: ['app/assets']
app/javascript/packs/application.js.// app/javascript/packs/application.js
import 'stylesheets/application'
This should fix your CSS compilation issue when you run bin/webpack-dev-server.