I know this may sound stupid, but does js files impede the building of war files?
I am working with my colleague and he is saying that building the war file takes longer with the bunch of js files in our project. I don’t think it will but i can’t find the answer.
There’s not enough information to answer your question. However, your co-worker may be correct. A WAR file is simply a ZIP file with a different extension. However, when you build a WAR file, many things generally happen. Your build procedure will usually do things like compiling Java files, creating metadata files, etc. It’s also possible that it performs concatenation, validation, and-or minimization of JavaScript files.
If your build process does optimize or validate JavaScript, then the number of JavaScript files might actually matter. However, this isn’t necessarily a bad thing. You probably don’t want to overdo it without reason, but it isn’t a problem as long as your build process does the necessary minimization steps.
Now, if your build process does not do anything to process JavaScript files, then your co-worker might be talking about another performance concern: Page load times. Having a bunch of JavaScript files to retrieve can have a significant impact on page load times for your users because of the amount of overhead in making a separate HTTP request for each file. This is further amplified in high latency situations like with mobile users. That’s why JavaScript minimization and concatenation steps are often included in modern build procedures.
So it’s possible your co-worker was mistaken about the reason for the performance concern, but was correct in suggesting you reduce your JavaScript file count. You should talk to the person who developed the build process. If there’s no JavaScript processing in the build scripts, then you should certainly keep your JavaScript file count low for the sake of your users. If there is, and you think your coworker is full of it, you should create about 50 JavaScript files (fill them with some random JavaScript) and run a build. If the build time doesn’t seem any longer, then you know your co-worker is incorrect.