What's the difference between concat and uglify and minify?

mheavers picture mheavers · Oct 30, 2013 · Viewed 27k times · Source

What's the difference between concat, uglify, and minify tasks in grunt? I set up an uglify task for all of my site's javascript tasks, and it seemed to both minify and concatenate them. Grunt's site has a great description for how to configure each task, but it doesn't seem to explain what each task actually does.

Answer

diclophis picture diclophis · Oct 30, 2013
  • Concatenation is just appending all of the static files into one large file.

  • Minification is just removing unnecesary whitespace and redundant / optional tokens like curlys and semicolons, and can be reversed by using a linter.

  • Uglification is the act of transforming the code into an "unreadable" form, that is, renaming variables/functions to hide the original intent... It is, also, irreversable.