Skip to content

Commit 34cae5f

Browse files
committed
Add text/ejs to register_transformer_suffix for ERBProcessor
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.
1 parent 9909da6 commit 34cae5f

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Get upgrade notes from Sprockets 3.x to 4.x at https://github.com/rails/sprocket
55
## Master
66

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

910
## 4.0.0
1011

lib/sprockets.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ module Sprockets
189189
text/scss
190190
text/yaml
191191
text/eco
192+
text/ejs
192193
), 'application/\2+ruby', '.erb', ERBProcessor)
193194

194195
register_mime_type 'application/html+ruby', extensions: ['.html.erb', '.erb', '.rhtml'], charset: :html

test/test_transformers.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def setup
121121
['application/javascript+ruby', 0.8],
122122
['application/coffeescript+ruby', 0.8],
123123
["application/eco+ruby", 0.8],
124+
["application/ejs+ruby", 0.8],
124125
['text/mustache', 0.8], # TODO: Extra step transform should be weighted down
125126
['text/x-handlebars-template', 0.8], # TODO: Extra step transform should be weighted down
126127
['application/dart', 0.8]

0 commit comments

Comments
 (0)