You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Webpacker allows you to skip compilation in the assets:precompile task if WEBPACKER_PRECOMPILE is set to false (rails/webpacker#1023). However, React on Rails will still run build_production_command.
Right now, we can manually workaround this like so:
ReactOnRails.configuredo |config|
# Copied from https://github.com/rails/webpacker/blob/7ed1c08e79c17680636fa99e6bb095ec1fbc8008/lib/tasks/webpacker/compile.rake#L36-L37skip_webpacker_precompile=%w[nofalsenf].include?(ENV["WEBPACKER_PRECOMPILE"])# This configures the script to run to build the production assets by webpack. Set this to nil# if you don't want react_on_rails building this file for you.unlessskip_webpacker_precompileconfig.build_production_command="RAILS_ENV=production bin/webpack"endend
But it would be great if React on Rails natively supported this for feature parity 👍🏻
The text was updated successfully, but these errors were encountered:
# Compile packs after we've compiled all other assets during precompilationskip_webpacker_precompile=%w(nofalsenf).include?(ENV["WEBPACKER_PRECOMPILE"])unlessskip_webpacker_precompile
@elstgav let me know if you want to create a PR or my team can do it.
Webpacker allows you to skip compilation in the
assets:precompile
task ifWEBPACKER_PRECOMPILE
is set tofalse
(rails/webpacker#1023). However, React on Rails will still runbuild_production_command
.Right now, we can manually workaround this like so:
But it would be great if React on Rails natively supported this for feature parity 👍🏻
The text was updated successfully, but these errors were encountered: