我使用第三方库,如下所示
(function ($) {
....
})(jQuery);在我的config.js中有这个js的条目
paths : {
'someLibrary' : 'path/to/someLibrary',
},
shim : {
'someLibrary' : { deps: ['jquery'] }
}没有r.js优化器,它工作得很好,但是一旦我运行优化器,
由于库代码中的jQuery is not defined,我得到了错误。
我该怎么解决这个问题?
编辑
我的r.js构建文件有mainConfigFile集。
发布于 2016-02-29 06:35:43
您可能需要在路径中添加jquery,如下所示
paths : {
'someLibrary' : 'path/to/someLibrary',
jquery : 'path/to/jquery'
},
shim : {
'someLibrary' : { deps: ['jquery'] }
}https://stackoverflow.com/questions/22803764
复制相似问题