RequireJS - 当给定某些别名时,jQuery未定义 [英] RequireJS - jQuery is undefined when certain alias is given

查看:72
本文介绍了RequireJS - 当给定某些别名时,jQuery未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在设置jQuery的路径时,每当我使用时:

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

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

然后:

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

$ 将是未定义的。

但是如果我正在使用:

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

然后:

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

一切都在突然发挥作用。

Everything is working great all in a sudden.

jQuery 定义jQuery的别名有什么问题?

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

推荐答案

这里有更多讨论: https://github.com / jrburke / requirejs / issues / 435

这篇关于RequireJS - 当给定某些别名时,jQuery未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆