Closed Tolsee closed 2 years ago
Caching of the bundle creation (i.e., determining if we need to re-run bin/webpack) should really be moved outside of the main development flow, and there should be a way to add additional values to the cache key.
@Tolsee another option could be to have your deployment dirs based a different Rails ENV for production and production_staging, and then configure that in webpacker.yml.
Consider not having automatic compilation for production/staging. You should have a build script.
Problem statement
When we use environment variables like:
Builds with these commands are actually different.
But, right now webpacker will say "Everything's up-to-date. Nothing to do"
Possible solution
When calculating digest, add dependent environment variables as well. https://github.com/rails/webpacker/blob/275fbb56e6b0c837ae4b214a276891558147d861/lib/webpacker/compiler.rb#L54-L61