Skip to content

Commit

Permalink
Fixed bug in browser require inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjpowers committed Jan 25, 2012
1 parent 2968822 commit a88fa6d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/air-drop.js
Expand Up @@ -18,7 +18,7 @@ var AirDrop = function(name) {
minimizer: Minimizers.None,
shouldPackage: false,
cacher: null,
explicitlyUseBrowserRequire: false
explicitlyUseBrowserRequire: null
});

_.extend(package, packageMethods);
Expand Down Expand Up @@ -87,7 +87,7 @@ var packageMethods = {
},

_shouldUseBrowserRequire: function() {
if(typeof this.explicitlyUseBrowserRequire !== "undefined") {
if(!_.isNull(this.explicitlyUseBrowserRequire)) {
return this.explicitlyUseBrowserRequire;
}
var implicitUse = _(this.paths).any(function(tuple) {
Expand Down Expand Up @@ -129,7 +129,7 @@ var packageMethods = {
}

app.get("/air-drop/" + package.packageName + ".js", function(req, res) {
package.useCachedResult(package.packageName, package.source, deliverSource(req, res));
package.useCachedResult(package.packageName, _.bind(package.source, package), deliverSource(req, res));
});

app.get("/air-drop/" + package.packageName + "/include/:filepath", function(req, res) {
Expand Down Expand Up @@ -180,8 +180,7 @@ var packageMethods = {
},

_applyMinimization: function(code) {
if(this.minimizer) { return this.minimizer(code); }
return code;
return this.minimizer(code);
}
};

Expand Down

0 comments on commit a88fa6d

Please sign in to comment.