Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easiest way to pack/minify multiple javascript files? [duplicate]

I'm looking for a website/program that will let me select multiple javascript files and output their minified versions in the order that they were selected. (E.g code of first selected files on top, last files in the end). Any ideas?

like image 900
Ali Avatar asked Jun 28 '11 14:06

Ali


People also ask

How do I reduce the number of JavaScript files?

Combine all JavaScript files in one file To minimize the number of HTTP requests you should try combining the content of all your JavaScript files to one bigger file. This isn't always possible with every JavaScript file, though. Try and see how it works out for your site.

Does minified JS run faster?

The main purpose of JavaScript minification is to speed up the downloading or transfer of the JavaScript code from the server hosting the website's JavaScript. The reason that minification makes downloads go faster is because it reduces the amount of data (in the minified JavaScript file) that needs to be downloaded.


1 Answers

Closure compiler (and I suspect most of the big JS compressors) already allow for this.

From java -jar closurecompiler.jar --help

--js VAL
: The javascript filename. You may specify multiple

like image 98
tjm Avatar answered Oct 20 '22 00:10

tjm