Reputation: 486
I am new to require.js. I am using html5shiv for IE polyfill, which execute only in IE.
Now, how to define IE specific condition in require.config ?
require.config({
paths: {
jquery: 'libs/jquery',
html5shiv : 'libs/html5shiv'
}
});
html5shiv should get loaded only in IE
Upvotes: 0
Views: 918
Reputation: 178
late to the party perhaps, but you can use bowser its already amd-ready
require(['bowser'],function(bowser){
if (bowser.msie && bowser.version < 9) {
//include your html5shiv/shim/modernizr here
}
});
best of luck!
Upvotes: 0
Reputation: 8346
The HTML5shiv code needs to happen in the <head>
and if you use some other means to load html5shiv.js
its built in shim code won't get called in time.
Upvotes: 1