-1

I have successfully collapsed all my jquery plugin files into a single file using: Combine multiple JavaScript files into one JS file

This resulted in creation of target.min.js. So far, so good. Should I be replacing all the places where I have previously included all jquery plugins? Also if I do that, wouldn't it be loading target.min.js the same number of times as I ll be replacing in all my html files with the target.min.js script instead of the plugin scripts?

Community
  • 1
  • 1
abhidoeslinux
  • 141
  • 3
  • 10
  • You can just include `target.min.js` once and remove all the js files that were combined to `target.min.js`. – Sachin Oct 20 '15 at 12:14

1 Answers1

0

You should replace all (not each) of those loads with a single target.min.js load.

Referencing that script multiple times should probably result in the browser loading it once and then just grabbing the rest of the references from cache and overwriting everything repeatedly, but that's not a great idea and asks for unexpected behavior, in addition to being massively inefficient.

It sounds like you may need to use some sort of template inheritance to avoid having all sorts of HTML files including all sorts of scripts without a central way to control it, but then your question does not provide enough information to go into any detail.

kungphu
  • 4,592
  • 3
  • 28
  • 37