If you are using backbone
(and backbone.marionette
) in a browserify
managed project, you will likely run into issues with underscore
(at least if you manage your dependencies with npm). Each package, that has underscore as a dependency, will require its own version of underscore
(making your bundle file contain multiple versions of underscore
). Back in the days, you could shim backbone
and underscore
like:
browserify({
shim: {
'underscore': {
path: './node_modules/underscore/underscore.js',
exports: '_'
},