Skip to content

Commit 21145b3

Browse files
committed
properly support nested ERB for .jst.hamlc with Sprockets 4
1 parent 1a25a57 commit 21145b3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/haml_coffee_assets/rails/engine.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,17 @@ class Engine < ::Rails::Engine
3636
config.assets.configure do |env|
3737
if env.respond_to?(:register_transformer)
3838
env.register_mime_type 'text/hamlc', extensions: ['.hamlc']
39-
env.register_mime_type 'text/jst+hamlc', extensions: ['.jst.hamlc']
4039
env.register_transformer 'text/hamlc', 'application/javascript', ::HamlCoffeeAssets::Transformer
40+
41+
env.register_mime_type 'text/jst+hamlc', extensions: ['.jst.hamlc']
4142
env.register_transformer 'text/jst+hamlc', 'application/javascript+function', ::HamlCoffeeAssets::Transformer
4243

4344
# support for chaining via ERB, documented via https://github.com/rails/sprockets/pull/807
44-
env.register_mime_type 'text/hamlc+ruby', extensions: ['.hamlc.erb', '.jst.hamlc.erb']
45+
env.register_mime_type 'text/hamlc+ruby', extensions: ['.hamlc.erb']
4546
env.register_transformer 'text/hamlc+ruby', 'text/hamlc', ::Sprockets::ERBProcessor
47+
48+
env.register_mime_type 'text/jst+hamlc+ruby', extensions: ['.jst.hamlc.erb']
49+
env.register_transformer 'text/jst+hamlc+ruby', 'text/jst+hamlc', ::Sprockets::ERBProcessor
4650
end
4751

4852
if env.respond_to?(:register_engine)

0 commit comments

Comments
 (0)