gmac / backbone.epoxy

Declarative data binding and computed models for Backbone
http://epoxyjs.org
MIT License
615 stars 89 forks source link

Fix for odd browserify behaviour #44

Closed adamscybot closed 10 years ago

adamscybot commented 10 years ago

Browserify is currently not compatible with backbone-epoxy as it appears it does not support resolving require(package) calls where package is a variable containing a string versus an actual string. E.g.

var underscore = "underscore";
var _ = require(underscore)

Does not work. However:

var _ = require("underscore")

works as expected. In the former example, browserify complains it cannot find the package. I believe browserify must be doing some strange parsing of the JS files in order to acertain where require() calls are so it can compile a single file.

The very simple solution is to just use strings (most if not all libraries I've seen do this).

gmac commented 10 years ago

Weird. Thanks... that streamlining using variables was overly engineered anyway!