使用RequireJS加载jQuery UI 1.12.x.

时间:2017-09-07 11:10:39

标签: jquery-ui requirejs

我正在尝试使用RequireJS v2.3.5加载jQuery 1.12.1 Slider小部件,所以我可以使用名为“jquery.selectBoxIt”的小部件,我的设置是这样的:

文件结构:

node_modules
AOP/Scripts/app/requireconfig.js

requireconfig.js

require.config({
    baseUrl: '/AOP/Scripts',
    paths: {
        'jquery.selectboxit': '../../node_modules/selectboxit/src/javascripts/jquery.selectBoxIt'
    },
    shim: {
        'jquery.selectboxit': ['jquery.ui.slider']
    },
    packages: [{
        name: 'jquery.ui.slider',
        location: '../../node_modules/jquery-ui/ui/widgets',
        main: 'slider'
    }],
});

但我收到了这些错误:

http://dev.k2.aop.local/AOP/Scripts/keycode.js 
Uncaught Error: Script error for "keycode", needed by: jquery.ui.slider/slider

GET http://dev.k2.aop.local/AOP/Scripts/widget.js 
Uncaught Error: Script error for "widget", needed by: jquery.ui.slider/slider

Uncaught Error: Script error for "version", needed by: jquery.ui.slider/slider
http://dev.k2.aop.local/AOP/Scripts/version.js 

Uncaught Error: Script error for "ie", needed by: jquery.ui.slider/mouse
http://dev.k2.aop.local/AOP/Scripts/ie.js

Uncaught Error: Load timeout for modules: jquery.selectboxit

我曾尝试将所有这些依赖项添加为RequireJs包,但最后会再次弹出此错误

Uncaught Error: Load timeout for modules: jquery.selectboxit,keycode/version,widget/version,ie/version

0 个答案:

没有答案