ndbroadbent / turbo-sprockets-rails3

Speeds up your Rails 3 assets:precompile by only recompiling changed files, and only compiling once to generate all assets
MIT License
976 stars 78 forks source link

Dependencies for Tilt::HamlTemplate ignored #68

Open chewi opened 11 years ago

chewi commented 11 years ago

I am generating static HTML files from Haml templates. I have noticed that these assets do not get updated when the dependencies change and after looking closer, it seems that turbo-sprockets isn't able to determine the dependencies. The problem appears to be twofold. To get it to work, I firstly had to add Tilt::HamlTemplate to the list of allowed engines in Sprockets::UnprocessedAsset. Secondly, calling stylesheet_link_tag and javascript_include_tag alone wasn't sufficient so I had to do this...

- depend_on_asset "foo.css"
= stylesheet_link_tag "foo.css"
- depend_on_asset "foo.js"
= javascript_include_tag "foo.js"

I don't want to have to fork turbo-sprockets just to change one line though so could Tilt::HamlTemplate be added? However, I do get the feeling that none of this should be necessary and I may have missed a trick somewhere.