Closed stuartgibson closed 4 years ago
Could you try the following one?
Rails.application.config.assets.configure do |env|
env.register_mime_type 'text/haml', extensions: ['.haml']
env.register_transformer 'text/haml', 'text/html', Hamlit::Template
end
I'm currently attempting to upgrade a Rails 4 app to Rails 6. It uses haml templates in the asset pipeline for Angular components. In Rails 4, this worked fine with Hamlit registered as an engine in the asset config with the following in an initializer:
Rails.application.assets.register_engine('.haml', Hamlit::Template)
In the Rails 6 version of Sprockets, register_engine is no longer available and I can't work out how to get haml assets to work locally as before. Any pointers appreciated.