For some reason the yepnope method didn't work, it still would load selectivizr as the first script, even before modernizr, this must be something to do with the asynchronous way yepnope works.
The way I've solved this in my case is to add a conditional comment before my html tag
<!--[if (gte IE 6)&(lte IE 8)]><html class="lt-ie9"><![endif]-->
I've then got a separate "ie-tidy.js" which I call from require js. So my config looks something like this (this is trimmed down)
requirejs.config({
paths: {
jquery: "../jquery-1.7.2.min",
app: ".",
selectivizr: '../selectivizr-min'
},
"shim": {
"cookie": ["jquery"],
"selectivizr": ["jquery"]
}
});
requirejs(['jquery', 'app/header', 'app/ie-tidy'], function ($) {
});
Then inside my ie-tidy.js I do the following (amongst other ie-specific scripts)
define(['jquery'], function ($) {
"use strict"
$(function() {
if ($('html.lt-ie9').size()) {
require(['jquery', 'selectivizr']);
}
});
});
This works exactly how I'd like it to, loading selectivizr after jQuery and applying the selectivizr classes as expected. Thanks for your help @Dzulqarnain