How to add inflections? #672
-
I'm trying to work with a component named I tried to create a plugin with a hook according to the docs. From my understanding, I want to hook in before Zeitwerk sets up. This aligns with the Zeitwerk docs, too. # plugins/builders/inflections.rb
class Builders::Inflections < SiteBuilder
def build
hook :loader, :pre_setup do |loader, _|
loader.inflector.inflect(
"ui" => "UI",
"Ui::Container" => "UI::Container"
)
end
end
end Here is the component:
I get the following error. Restarting the site doesn't help. (Replacing the namespace with
It also doesn't seem like the call inside of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This is one of those edge cases that Bridgetown 1.2 initializers attempt to fix. Not sure if you're using that yet, but if you are, you should be able to move that loader |
Beta Was this translation helpful? Give feedback.
This is one of those edge cases that Bridgetown 1.2 initializers attempt to fix. Not sure if you're using that yet, but if you are, you should be able to move that loader
hook
intoconfig/initializers.rb
and that will get run at the appropriate moment.