react_on_rails icon indicating copy to clipboard operation
react_on_rails copied to clipboard

bin/webpacker is running twice during assets:precompile if

Open justin808 opened this issue 2 years ago • 1 comments

This change is broken:

https://github.com/shakacode/react_on_rails/commit/9637c09e46372f92d09113a2eb61b3658b47b351#diff-ee77363403f2346e5588ba25b2ef77d2b8e70d3c699fec17edf68fa3dd3b6766R127

Repro:

  1. Set react_on_rails.rb to have config.build_production_command = "yarn start build.prod"
  2. Run RAILS_ENV=production NODE_ENV=production rake assets:precompile. bin/webpacker will run twice.

Workaround

WEBPACKER_PRECOMPILE=false bin/rake RAILS_ENV=production NODE_ENV=production assets:precompile

justin808 avatar Apr 08 '22 01:04 justin808

@justin808 In other words, there is no way to add ENV["WEBPACKER_PRECOMPILE"] = "false" conditional on the presence of config.build_production_command

Judahmeek avatar Apr 08 '22 01:04 Judahmeek