I am using YepNope as a resource loader, but I am now having to support Less files, but I cannot seem to get it to load these files, I did read:
https://github.com/SlexAxton/yepnope.js/pull/64
But it doesn’t really say how it should be done… do I have to add a custom filter or prefix with !less and then manually write it out to the DOM?
I would basically be doing something like:
yepnope("path/to/file.less")
Here’s what I do:
This will create a yepnope prefix function for any URL that starts with
less!. The function will force it to be loaded as CSS and also place therelandtypeattributes in the<link>element, which are required for LESS to parse the files. Make sure you’re using yepnope 1.5+, or Modernizr.Then, in your load statements:
Which will first load your
*.lessfiles, and then process them with the LESS JavaScript.