Skip to content

Commit

Permalink
Add text/ejs to register_transformer_suffix for ERBProcessor
Browse files Browse the repository at this point in the history
Processes .jst.ejs.erb files through ERBProcessor before continuing on
with EjsProcessor and JstProcessor.

A similar change was made in #491 to support .jst.eco.erb files.
  • Loading branch information
cgunther committed May 12, 2020
1 parent 9909da6 commit 34cae5f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Get upgrade notes from Sprockets 3.x to 4.x at https://github.com/rails/sprocket
## Master

- Fix for Ruby 2.7 keyword arguments warning in `base.rb`. [#660](https://github.com/rails/sprockets/pull/660)
- Process `*.jst.ejs.erb` files with ERBProcessor [#674]

## 4.0.0

Expand Down
1 change: 1 addition & 0 deletions lib/sprockets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ module Sprockets
text/scss
text/yaml
text/eco
text/ejs
), 'application/\2+ruby', '.erb', ERBProcessor)

register_mime_type 'application/html+ruby', extensions: ['.html.erb', '.erb', '.rhtml'], charset: :html
Expand Down
1 change: 1 addition & 0 deletions test/test_transformers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def setup
['application/javascript+ruby', 0.8],
['application/coffeescript+ruby', 0.8],
["application/eco+ruby", 0.8],
["application/ejs+ruby", 0.8],
['text/mustache', 0.8], # TODO: Extra step transform should be weighted down
['text/x-handlebars-template', 0.8], # TODO: Extra step transform should be weighted down
['application/dart', 0.8]
Expand Down

0 comments on commit 34cae5f

Please sign in to comment.