palkan / view_component-contrib

A collection of extension and developer tools for ViewComponent
MIT License
369 stars 22 forks source link

feat: Do not load Previews when the feature is disabled. #26

Closed dhnaranjo closed 2 years ago

dhnaranjo commented 2 years ago

What is the purpose of this pull request?

Avoid loading, for example, test-only gems in production when using sidecar previews. As discussed https://github.com/palkan/view_component-contrib/discussions/24

What changes did you make? (overview)

Added initializer that excludes all files ending in preview.rb in any preview path.

Is there anything you'd like reviewers to focus on?

Nah

Checklist

palkan commented 2 years ago

Thanks!