I've been reading a few documentations on Node.js recently to try and get me started on some personnal work. During the process, a thought came up again and again, but I couldn't quite get a satisfactory answer.
In every piece of code I've seen so far, there were quite a few require(). I understand the primary function of it is to include modules. But it seems like people used it to include other Javascript files in their main, too. As far as I know, there is no proper way to do that in Javascript (as stated here: How do I include a JavaScript file in another JavaScript file?).
Here is my concern; seperating files according to their functions is obviously good to improve readibility. However, isn't require() slowing down drastically the programm since it has to fetch information by opening the Javascript file and so on? If so, is the difference significant enough to worry about in a web application?
Wouldn't it be more prudent to write a programm that automates the assembly process in order to obtain a single file (or at least a more monolithic one) before submitting the version?