Is there a tool to automatically minimize all javascript files specified in the html file during deployment?

Is there a tool that will do the following during deployment?

  • Find all javascript files specified in the <script> tags of the html document.
  • Minimize javascript files to 1 file.
  • Replace the <script> tags in the html file with only one pointing to the mini file.

I cannot be the only one who wants to do this, so before writing the tool itself, is there already a utility that does this?

I am using Go on Google App Engine.

+4
source share
3 answers

What is your server technology? If it's ASP.NET, see http://www.RequestReduce.com . It will link and minimize all the <script> and <link rel="stylesheet> tags among other optimizations.

+3
source

You might want to describe which code stack you are using, i.e. LAMP, Java EE ....

For PHP, this looks attractive: http://code.google.com/p/minify/

0
source

You can use build tools like Makefile or Ant

0
source

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


All Articles