I’ve got a manifest file partials.js which contains this:
//= require_tree ./partials
And then each coffee file in ./partials/ contains this:
$ ->
# Rest of the code
Is it possible to have something like this in the manifest:
$(function () {
//= require_tree ./partials
});
and remove the $ -> wrapping in the individual files?
(This doesn’t actually work at the moment. The code gets pushed to the bottom, with the required js above.)
I recently ran into the same issue what I ended up doing was this:
taking your manifest example of:
we can turn it in to a manifest that looks like this:
and then we make
head.js:and then we make
tail.js:The trick is ending the head.js partial with a commented semicolon. Other wise the preprocesser will try to inject a semicolon breaking the script making someothing like this