jrburke/requirejs — Issue #139: Client side NPM support
Author: tf
Created: 2011-11-09 22:14:19+00:00
State: open

Hello,

we are trying to factor a set of client side libraries into npm modules to make versioning and dependencies explicit. Using AMD conventions for the outer defintion of our models, those can be loaded with requirejs. I applied the `packagePaths` config option to point requirejs to the `node_modules` directory - which worked great -, but found myself duplicating a lot of information from the individual package.json files in each client of a library. In particular, I seemed to be forced to list all transitive package dependencies, which would lead to an unmaintainable setup if I have to change the `packagePaths` option in each client, when a dependency is added to a library.

Therefor, my question: Am I doing something wrong? Or is it just a not so common use case? If my above explanation should not be clear enough, I'd be glad to elaborate or give a more concrete example.

For now we consider switching to ender.js, whose `require` mechanism seems to be suited to solve our exact problem. Either way, requirejs's no-build-step approach appeals to us very much.

Best
Tim