方法一:
使用shim 为zepto增加exports 垫片
require.config({
baseUrl: '/js',
paths: {
jquery: 'jquery-1.11.2.min',
zepto: 'zepto.min',
underscore: 'underscore.min'
},
shim: {
"zepto": {
exports: "$"
},
"underscore": {
exports: "_"
}
}
});
方法二:
修改zepto库,在zepto.min.js 末尾增加如下代码
// If `$` is not yet defined, point it to `Zepto`
window.Zepto = Zepto;
'$' in window || (window.$ = Zepto);
if (typeof define === "function" && define.amd) {
define("zepto", [], function () {
return Zepto;
});
}