You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spent quite some time figuring out I needed the following syntax to get dependencies detected for my .html.erb files:
<!-- /* rails-erb-loader-dependencies ... */ -->
I see two solutions:
document this properly
iso. /* rails-erb-loader-dependencies ... */ implement searching for: rails-erb-loader-dependencies (which allows users to use the proper comment syntax for the resulting file, and which is backwards compatible)
It would also be fine if we could support <%# rails-erb-loader-dependencies ... %>, which leaves no traces in the end result, and would also work for stuff that doesn't support comments (e.g. .json.erb)
I am willing to create a PR for this if you decide which of the two solutions you prefer...
The text was updated successfully, but these errors were encountered:
If you don't want the directive to end up in the result, or wish to use it outside of a javascript context,
include the javascript comment block inside an erb comment block.
The reason this was not included in the docs is because comments should be removed in minification in your release build (same goes for all preprocessor directive comments, eslint etc etc)
I spent quite some time figuring out I needed the following syntax to get dependencies detected for my
.html.erb
files:I see two solutions:
/* rails-erb-loader-dependencies ... */
implement searching for:rails-erb-loader-dependencies
(which allows users to use the proper comment syntax for the resulting file, and which is backwards compatible)It would also be fine if we could support
<%# rails-erb-loader-dependencies ... %>
, which leaves no traces in the end result, and would also work for stuff that doesn't support comments (e.g..json.erb
)I am willing to create a PR for this if you decide which of the two solutions you prefer...
The text was updated successfully, but these errors were encountered: