Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure rails app is initialized before inferring config #240

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

ElMassimo
Copy link
Owner

Description 📖

This pull request ensures that when using vite_rails the parent Rails app is initialized before the config is resolved.

This ensures that it's safe to access Rails config values in config/vite.rb, and that settings like asset_host are always detected.

Background 📜

This pull request is a follow-up to:

The attempt to fix it only solved some situations, but does not work in all cases.

The Fix 🔨

Explicitly requiring the application and initializing it ensures the config is available before running a build

@ElMassimo ElMassimo merged commit 2c4ac93 into main Aug 12, 2022
@ElMassimo ElMassimo deleted the fix/rails-init branch August 12, 2022 00:56
ElMassimo added a commit that referenced this pull request Aug 12, 2022
Ensure that when using vite_rails the parent Rails app is initialized before the config is resolved.

This ensures that it's safe to access Rails config values in config/vite.rb, and that settings like asset_host are always detected.
ElMassimo added a commit that referenced this pull request Aug 12, 2022
Ensure that when using vite_rails the parent Rails app is initialized before the
config is resolved.

This ensures that it's safe to access Rails config values in config/vite.rb, and
that settings like asset_host are always detected.
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.

1 participant