RequireJS - jQuery is undefined when certain alias is given

天大地大妈咪最大 提交于 2020-01-14 08:13:08

问题


When setting the path for jQuery, whenever I am using:

require.config({
    paths: {
        'jQuery': './libs/jquery-1.8.0.min'
    }
});

Then:

define(['jQuery'], function($) {
    console.log($);
};

$ is gonna be undefined.

However if I am using:

require.config({
    paths: {
        'jquery': './libs/jquery-1.8.0.min'
    }
});

Then:

define(['jquery'], function($) {
    console.log($);
};

Everything is working great all in a sudden.

What's the issue with defining jQuery's alias with jQuery?


回答1:


This was discussed more over here: https://github.com/jrburke/requirejs/issues/435



来源:https://stackoverflow.com/questions/12121367/requirejs-jquery-is-undefined-when-certain-alias-is-given

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!