Skip to content

Commit

Permalink
Merge branch 'master' into 189-hamlc-is-processed-by-jst
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieujobin authored Jul 19, 2024
2 parents 27b6e1e + 3a0043e commit a3a7d7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source 'https://rubygems.org'

gemspec

gem "rack", "~> 2" # Rack 3 is not compatible with Jasmine and fails -- jasmine-3.99.0/lib/jasmine/server.rb:12:in `start': uninitialized constant Rack::Server (NameError)
gem "rails", "~> #{ENV['RAILS_VER'] || raise("missing rails version")}"
gem "sprockets", "~> #{ENV['SPROCKETS_VER'] || raise("missing sprockets version")}"

5 changes: 5 additions & 0 deletions lib/haml_coffee_assets/rails/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class Engine < ::Rails::Engine
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
# delete? env.register_transformer 'text/hamlc', 'application/javascript+function', ::HamlCoffeeAssets::Transformer

# support for chaining via ERB, documented via https://github.com/rails/sprockets/pull/807
env.register_mime_type 'text/hamlc+ruby', extensions: ['.hamlc.erb', '.jst.hamlc.erb']
env.register_transformer 'text/hamlc+ruby', 'text/hamlc', ::Sprockets::ERBProcessor
env.register_transformer 'text/jst+hamlc', 'application/javascript+function', ::HamlCoffeeAssets::Transformer
end

Expand Down

0 comments on commit a3a7d7e

Please sign in to comment.