I am looking into a way to write by BackboneJS application using a CommonJS structure which allows Javascript modules to be required. This application could then work on the client or server side with node.
I have looked into requirejs and other similar options but you have to write the app in a specific way which in my opinion looks really naff.
I have also looked at browserify and webmake which takes your code and any modules that are required and combines them into a single js file with the missing (require) methods. All a clever idea, but leaves the code on the client side a bit messy.
Is there such a thing out there which can take by code written in its commonJS format, compile all the required modules that are compatible with the browser and spit out a Javascript file (or several) that can be used in the browser without having to worry about missing require methods? Even better would be a solution tailored to backbone applications.