Skip to content

Conversation

@Austio
Copy link

@Austio Austio commented Nov 29, 2020

This PR adds support for 'erb' compilation of webpacker.yml config files.

Without this change, webpacker.yml will forever live on it's own and be responsible for loading a config file manually and work in unexpected ways, like ERB compilation not working inside of webpacker.yml loading similar to how all other config files work.

After this change, webpacker.yml will now act like every other "rails" yml file that people are used to and things like the below will evaluate properly when the environment is set properly

development: 
  host: <%= ENV.fetch('SOMETHING') { true } %>

Internally, this is a small change, we use the Rails.application.config_for method that is used for all other configuration loads and handles erb compilation.

I looked through the github history and this did not seem like a design decision to intentionally not include compilation.

Closes: #1615

…ad of direct loading.

The rails config_for method handles several things that we want, like compile the .yml file with erb.  Without this chance, webpacker.yml will forever live on it's own and be responsible for loading a config file manually.
@Austio Austio closed this Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow environment settings in webpacker.yml with ERB

1 participant