rails / webpacker

Use Webpack to manage app-like JavaScript modules in Rails
MIT License
5.31k stars 1.47k forks source link

Fix so webpacker:install does not require webpacker.yml pre-existing #3223

Closed justin808 closed 2 years ago

justin808 commented 2 years ago

If you run ./bin/rails webpacker:install on a rails app with no config/webpacker.yml, we get a crash with this error:

Webpacker configuration file not found webpacker-v6/config/webpacker.yml.

Please run rails webpacker:install Error: No such file or directory @ rb_check_realpath_internal - webpacker-v6/config/webpacker.yml

With this fix, allow the installer to run.

Problem solved with a global to indicate installing so that default configuration is used rather than crashing because the yet to be installed config/webpacker.yml is not yet installed.

Fixes this old, very confusing issue https://github.com/rails/webpacker/issues/940#issuecomment-757482835.

guillaumebriday commented 2 years ago

Great! LGTM, waiting for an answer to your question before merging

justin808 commented 2 years ago

@guillaumebriday this one should be ready for merging.

guillaumebriday commented 2 years ago

Great!