madrobby/zepto — Issue #297: var Zepto
Author: aglemann
Created: 2011-10-27 16:23:36+00:00
State: open

When using Zepto with a dependency manager like RequireJS that wraps the dependencies in function calls, the

var Zepto = (function() {

is treated like a local variable when optimizing (with Uglify or whatever) so gets "optimized" to something like:

var a = (function() {

which then breaks Backbone which looks for Zepto in global context. Easy solution is just to remove the "var" declaration:

Zepto = (function() {