concat和uglify和minify有什么区别? [英] What's the difference between concat and uglify and minify?

查看:239
本文介绍了concat和uglify和minify有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

concat,uglify和grunt中的minify任务有什么区别?我为我的网站的所有javascript任务设置了一个uglify任务,它似乎既缩小又连接它们。 Grunt的网站对如何配置每个任务有很好的描述,但似乎并没有解释每个任务实际上做了什么。 解决方案

ul>

  • 串联只是将所有静态文件附加到一个大文件


  • 缩小只是删除不需要的空白和冗余/可选标记,如卷曲和分号,可以通过使用linter来反转

    。 Uglification 是将代码转换为不可读形式的行为,即将变量/隐藏原意的功能......也是不可逆转的。


  • 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.

    解决方案

    • 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.

    这篇关于concat和uglify和minify有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆