Question

I'm looking for a solution to combine several javascript files into as few as possible. I currently have many files from external sources like twitter, facebook, google+ etc.. as well as few of my own.

Is it possible to somehow automatically combine this into one, or as few as possible files?

If not all of them than combine external and internal files separately.

Was it helpful?

Solution

If downloading the external files and placing them in your server is an option, the you can use a tool like:

To compile the js (and usually minify it) into one big file.

That being said I recommend that you keep the external files in the external cdn you load them, because they probably cache them and it'll be faster.

Keep in mind that having only one file isn't always the best way to go (it depends on things like size of the resulting file, if you really have to load it, etc).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top