barc/backbone.giraffe — pull request #22 by bobthecow (2014-01-07 17:53:53+00:00)
Title: Make Giraffe play nice with AMD and node-style loaders.

This adds a fallback call to `require('underscore')` and `require('backbone')` as a last ditch effort if they’re not available when the script loads.

It also registers `module.exports` if that’s around, or registers 'backbone.giraffe' as an AMD module if that’s a thing — `define('backbone.giraffe', …)`.

With this change, Giraffe can be used shimless in Browserify, and (probably?) in most CommonJS- / AMD-aware loaders and packaging tools.