Minimize / Merge JS Files

I have about 6-7 javascript files that I want to minimize and combine. I am reducing my javascript here: http://www.minifyjavascript.com/

I find it difficult to "combine" my javascript. By combining, I just copy and paste all javascript into one huge js file? If I do this, I will have about 1000 lines of code, and I have to figure out the exact dependencies. Is there a simple online program that can do this for me? Also, do I need to combine scripts like jquery with my scripts?

Any help would be appreciated.

+6
source share
4 answers

There is a Google Closure compiler that will combine JS files and reduce them to the level of your choice. This, of course, saves a lot of time on cutting and gluing, which, as you probably know, can become very difficult.

+8
source

I just use Notepad ++ and the JSMin plugin. I would just copy them in the order in which you included them in your html files.

And no, I would not combine the jsquery plugin with it. Keep them separate so you can update them independently.

+4
source

Check PackScript.

http://danderson00.blogspot.com.au/2013/01/packscript-next-generation-build-for-web.html

He does everything you need and much more.

0
source

Check out this python script.

http://github.com/hkasera/minify

It also minimizes js as well as css files. It stores detailed log files, and you can add this script as a git hook and save yourself from executing manually each time.

Hope this helps!

0
source

Source: https://habr.com/ru/post/886662/


All Articles