Created
July 12, 2014 06:06
-
-
Save giiska/91e7cdfa58807d9ef9c8 to your computer and use it in GitHub Desktop.
set require.config path of `jquery` to `zepto` when use backbone-amd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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