komponent icon indicating copy to clipboard operation
komponent copied to clipboard

Set load path from gem instead of using install generator

Open Spone opened this issue 6 years ago • 3 comments

Following #121 and #136, what about calling this line:

config.paths.add "frontend/components", eager_load: true

directly from the gem instead of adding it to config/application.rb when running the install generator.

Let's make a list of advantages and potential drawbacks!

Spone avatar Mar 26 '19 22:03 Spone

If you load it directly from gem, you loose advantage of changing default root path (https://github.com/komposable/komponent#change-default-root-path). But maybe not an issue to remove that option ?

florentferry avatar Mar 28 '19 08:03 florentferry

Can't we use the Rails.application.config.komponent.root value in config.paths.add in case it's called from the gem?

Spone avatar Mar 28 '19 09:03 Spone

It's what https://github.com/komposable/komponent/blob/eb4267b40f927ab2cad840d644353d38a9e36a60/lib/komponent/engine.rb#L55 does, no?

nicolas-brousse avatar Nov 19 '19 22:11 nicolas-brousse