Closed bertBruynooghe closed 2 years ago
I think the original description should remain unchanged (or say there are pitfalls) and mention the pitfalls below with your example code <!-- /* rails-erb-loader-dependencies ... */ -->
I took the liberty to change the original description slightly ('javascript comment block'), as that makes it clear that // rails-erb-loader-dependencies...
doesn't work either.
As to including <!-- /* rails-erb-loader-dependencies */ -->
: that only works for html files, while <%# /* rails-er-loader-dependencies %>
works more universally (e.g. .json.erb
). Adding more examples only adds to the confusion.
That being said, I still think leaving the comment signs out of the detection would make more sense than adapting the documentation, as the current implementation is a violation of the Principle of Least Astonishment, at the heart of ruby and rails.
Ya just think updating the README is a faster improvement Let's keep #107 open and see if further improvements can be made
Make it more obvious that the javascript comment block is necessary to get dependency loading working. (Especially when not using .js.erb files.)