We have been working on a codeigniter hmvc project for quite sometime now and it has grown into a lot of back-end modules and controllers. For the front end we have been applying the regular jQuery and plugin approach along with inline scripting for Front end interaction and Ajax related tasks. Also we used HTML strings inside JS as our approach to templating.
But since now the application has gone big, we are in need to embrace the modular approach for our client side code along with implementing a build system for optimization of JS code. During our research we found a few candidates that would help us start managing the code. We zeroes in on requirejs for dependency management and for templating we are considering on out of handlebars/moustache/dust.js.
However, it seems like most of the applications using require and templating are based on backbone and are basically one page web apps. So, how do we implement the front end modularity and templating as a part of our already working (and growing) Codeigniter hmvc application ?