How much can I stretch RequireJS to provide dependency injection for my app? As an example, let\'s say I have a model that I want to be a singleton. Not a singleton in a s
If you're serious about DI / IOC, you might be interested in wire.js: https://github.com/cujojs/wire
We use a combination of service relocation (like Domenic describes, but using curl.js instead of RequireJS) and DI (using wire.js). Service relocation comes in very handy when using mock objects in test harnesses. DI seems the best choice for most other use cases.