require-package is a simple library to build a config object that can
be used with the requirejs AMD loader. It will
generate the appropriate path, shim and module information for your
specified environment, enabling the packaging information to be
specified in only one place.

For example, in your package json:

"vendor": {

"backbone": {

"source": "node_modules/backbone.js",

"shim": {"exports": "Backbone", "deps": ["underscore","jquery"]}

},

"underscore": {

"source": "node_modules/underscore/underscore-min.js",

"shim": {"exports": "_"}

},

"jquery": {

"source": "vendor/js/jquery-1.8.1.min.js"

}

}

Then, you can build use require-package in various places to vendor and
build a config file for requirejs.