Skip to content

Instantly share code, notes, and snippets.

@giiska
Created July 12, 2014 06:06
Show Gist options
  • Save giiska/91e7cdfa58807d9ef9c8 to your computer and use it in GitHub Desktop.
Save giiska/91e7cdfa58807d9ef9c8 to your computer and use it in GitHub Desktop.
set require.config path of `jquery` to `zepto` when use backbone-amd
/**
* extend/zepto.js
*/
define([
'zepto'
], function() {
"use strict";
window.Zepto = Zepto
// If `$` or `jQuery` is not yet defined, point them to `Zepto`
'$' in window || (window.$ = Zepto)
'jQuery' in window || (window.jQuery = Zepto)
return Zepto;
});
// Then set jquery path to extend/zepto:
require.config({
paths: {
'zepto': 'path/to/original/zepto',
'jquery': 'extend/zepto'
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment