I am trying to require a file with browserify using variables passed into a function:
var playersOptions = { name: 'players', ajax: 'team-overview', route: { name: 'overview', path: 'playersOverview', url: 'playersoverview' } }; var BackboneView = require(playersOptions.route.path); //Error: Uncaught Error: Cannot find module 'playersOverview' var BackboneView = require('playersOverview'); //Requires the file without any problems. I am confused as to why this would fail? How can it not find the module when both are strings?