문제

I want to set the baseurl to the folder where Require js is in, which is called js. Now I have this funny/ frustrating phenomenon that when I write

require({
        baseUrl: './'
    });

It sets the baseUrl to the url from which the document is loaded, when I set it to

 require({
        baseUrl: './js'
    });

It sets takes sets it the folder [MyProjectfoder]/js/js/ with the second js being "wrong" of course, since I want it to set it relative from my page... Any idea what I'm doing wrong?

The reason why I need is is, that I want to load plugins like the text or async plugin, which are taken form the baseurl, so if it is not the right director, the plugins can't be found.

도움이 되었습니까?

해결책

Sometimes, when I write URLs, I forget which directory it is pointing to.
Try using:

require({
     baseUrl: 'js'
 });

I hope it helps. If not, just leave a comment.

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