I'm developing some Javascript front-end code using JQuery with some back-end JSON webservices. IDE is Netbeans, and debugging using that and Chrome.
Coming from a C++ background I'm used to small source files, each encapsulating one (or a small handful) of classes. With JS, the lack of simple 'include files' means that I have gradually found myself dealing with monolithic blocks of 1K+ lines of Javascript.
I've looked at using nginx server-side includes to split these, but this ties the code tightly to the webserver, which isn't ideal. Dynamically loading each source file as a separate request seems inefficient, so I guess I want something that will combine (and optionally minimize) the source code as part of the IDE build/debug cycle.
I'm fairly new to JS development, so have no idea about best practices for this.
My code is already object-oriented, but I have a few very large source files, which makes change management, editing, etc. difficult. I'm looking for the best approaches to splitting the code into multiple smaller source files, and how best to get those delivered to the client side.