There is no real difference between the two. Even Uglify calls itself a minimization toolkit.
The difference may be more relevant when comparing JS minimization with CSS minimization. Minimizing CSS involves only removing spaces - the source code remains intact.
Using JS, you can not only remove spaces, but also make conversions to code, such as trimming variable names into individual characters.
Minimizing JavaScript not only reduces the source, but also makes the code less readable or obfuscated. But do not work on the assumption that minimization or avoidance, or what you want to call, is a safety measure. This is not encryption. The code is more difficult to read, but not impossible to read, and although it is usually impossible to return the restored code back to its original form, it can be “decorated” and made more readable.
It does not matter for both minify and uglify, since most minifiers will remove whitespace and unnecessary characters, as well as obfuscate the code. Everything you do is a new build step.
source share