DEPRECATED
Use Backbone 0.9.9=<
Backbone has added exports support as of 0.9.9, so just use the normal Backbone package.
To use Backbone with jQuery, remember to set $
after you require Backbone.
var $ = ; var Backbone = ;Backbone$ = $; MyView = BackboneView; ;
Backbone-browserify
node-browserify.
packaged for use withBreaking change 0.9.2-1
Removed require('jquery') in Backbone source for $
assignment. Didn't make sense, see #6
Install
npm install backbone-browserify
Important: You must require jquery-browserify
, 'br-jquery', or Zepto (untested) with Browserify before you require Backbone, just like normal.
Just add it to your browserify require list and use it! Make sure you also have Underscore installed via npm as Backbone will automatically require it.
Server Side
;
... or to alias it to just "backbone":
;
Express example
app;
Client Side
***Include browserify.js
like this first: <script src="browserify.js"></script>
var $ = jQuery = Backbone = MyView = BackboneView; ;
... or if you aliased it to 'backbone':
var $ = jQuery = Backbone = MyView = BackboneView; ;