Skip to content

Commit

Permalink
fix: [#189] Fix .hamlc is unexpectedly processed by JstProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
voducvu committed Jun 24, 2024
1 parent 2180fce commit 27b6e1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/haml_coffee_assets/rails/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ class Engine < ::Rails::Engine

config.assets.configure do |env|
if env.respond_to?(:register_transformer)
env.register_mime_type 'text/hamlc', extensions: ['.hamlc', '.jst.hamlc']
env.register_mime_type 'text/hamlc', extensions: ['.hamlc']
env.register_mime_type 'text/jst+hamlc', extensions: ['.jst.hamlc']
env.register_transformer 'text/hamlc', 'application/javascript', ::HamlCoffeeAssets::Transformer
env.register_transformer 'text/hamlc', 'application/javascript+function', ::HamlCoffeeAssets::Transformer
env.register_transformer 'text/jst+hamlc', 'application/javascript+function', ::HamlCoffeeAssets::Transformer
end

if env.respond_to?(:register_engine)
Expand Down

0 comments on commit 27b6e1e

Please sign in to comment.