Webpacker with custom rails env like staging or demo RAILS_ENV=staging bundle exec rails assets:precompile RAILS_ENV=staging bundle exec rails webpacker:compile RAILS_ENV=staging NODE_ENV=production ./bin/webpack