I have a huge web app in Javascript and its starting to become something of a hassle to manage everything. I broke everything up into little files each with their own subsection of the app.
eg. if the app is named "myApp" I have a file called
myApp.ajax.js which contains
myApp.ajax = (function(){return {/*stuff*/}})();
and one called
myApp.canvas.js which contains
myApp.canvas = (function(){return {/*stuff*/}})();
so on and so forth. When I concatenate all the files and minify them I get a huge garbled mess of all of this together. So I was wondering, Is there a build system that would turn all of this int one single
var myApp = {
ajax: /*stuff*/,
canvas: /*stuff*/,
/*etc*/
}
when it compiles everything?
I ask because I ran a small test and noticed a serious perfomance decay when having each part of the object seperate. Test is here: http://jsperf.com/single-object-vs-multiples