I want to exclude a particular javascript file (modernizr) from the pipeline because I want it to load separately.
I want to load Modernizr at the beginning and the rest of my javascript concatenated at the end.
Is there way to do the opposite of a require in the asset pipeline in 3.1? ie. an exclude?
Thanks in advance.
Adam.
I chose to keep the sprockets functionality by changing
//= require_tree
to
//= require_directory .
This keeps sprockets auto-loading any files in the same directory, but not in any folders further.
This allowed me to move Modernizr.js to the assets/javascripts/top folder and manually load it at the top with:
<%= javascript_include_tag "top/modernizr" %>
and move
<%= javascript_include_tag "application" %>
To the bottom of my application.html.erb file (above the closing body tag)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With