Does it make sense to do both minimization and evasion?

Given that evasion is associated with some minimization in the process, does it make sense to do both minimization and uglify? If so, should you first transfer or guess? Is only enough to corrode? Will the code be more confusing if both are done?

+5
source share
2 answers

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.

+7
source

Minifying simply removes unnecessary empty space and redundant comments and semicolons. And if necessary, it can be undone back.

Uglifying converts the code into an “unreadable” form by changing variable names, function names, etc., to hide the original content. Once it is used, there is no way to cancel it back.

Some libraries, such as UglifyJS, do mini-code when used, removing unnecessary parts. But overall, Uglifying makes code unreadable.

Simplifying the code speeds up the loading of your page, which makes visitors and search engines happy, and it is also readable. Most major browsers minimize code before execution.

+3
source

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


All Articles