Allow compile option to be settable #2063
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Similar to
check_yarn_integrity=
, the changes toRAILS_ENV
/NODE_ENV
setting has made it basically impossible to mix pre-compilation with on-the-fly compilation for a given RAILS_ENV.In my setup, I precompile assets in CI, run them through tests (RAILS_ENV=test), and deploy them to production (RAILS_ENV=production) all based on the same precompiled assets.
The two options I have are:
RAILS_ENV=test_ci
and change those settings inwebpacker.yml
to conform with that. Maintaining multiple RAILS_ENV's is confusing and not worth the effort in my opinion.RAILS_ENV=test
to use pre-compilation. That is not a good development experience.I would use this setter to basically conditionally turn on the
compile
flag based on whether theENV['CI']
flag was set (very common in pretty much every CI provider). I used to hack around this pre-3.5.x by just changing theNODE_ENV
on the fly. This no longer works.As a maintainer @gauravtiwari I can understand why you might not be interested in allowing another form of configuration, but I think maybe leaving it undocumented could be one way to provide
sharp tools
. Alternatively, mysharp tools
can be directly altering the@data
hash of Webpacker configuration. Maybe that is sufficient, but curious to hear your thoughts.P.S. The other hack I'm doing is sym-linking
packs
topacks-test
in CI, so that prod/test seamlessly use the same pre-compiledpacks
location