0

We recently had our video service go down and the reason revolved around a company who's plugin we used had concatenated 2 js files, but the concatenation stopped working.

They had code like this:

<script type="text/javascript" src="//url.com/direc1/concat-direc/file1,file2.js"></script>

I was just wondering what the benefit (if there even is any) that there is to doing something like this?

My thoughts were:

  • Speed

  • Cleaner file structure

  • Easier includes?

  • Cuts down on the amount of script calls

Is this more beneficial then just including 2 minified JS files, like this?

<script src="file1"> </script>
<script src="file2"> </script>
knocked loose
  • 3,142
  • 2
  • 25
  • 46
  • Sorry for the duplicate, I searched "what are the benefits to concatenating JS files" before posting but didn't see the question you tagged. Thanks for the help! – knocked loose Mar 31 '16 at 14:39
  • @ether: "JavaScript" would have probably been more useful than "JS" in your search, for future reference. –  Mar 31 '16 at 14:39
  • @squint very true, I just get into that groove of using 'JS' to type between colleagues. I will remember search better next time :) – knocked loose Mar 31 '16 at 14:40
  • No problem. I personally never use StackOverflow's search tool. I use Google, and include `site:stackoverflow.com javascript ...`, and it gives me really good results. –  Mar 31 '16 at 14:41

0 Answers0