문제

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

도움이 되었습니까?

해결책 2

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!

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top