Rails资产-保留许可证注释 [英] Rails assets - keep license comments

查看:62
本文介绍了Rails资产-保留许可证注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何防止Uglifier从某些文件中删除一些注释?我想缩小代码并压缩代码,但我也希望许可注释保持不变.

How can I prevent Uglifier from removing some comments from some files? I want to have code minified and compressed but also I want the licensing comments to remain intact.

推荐答案

来自uglifyJS的文档.

From the documentation of uglifyJS.

-nc--no-copyright —默认情况下,uglifyjs会将初始注释标记保留在生成的代码中(假定为版权信息等).如果通过此操作,它将丢弃它.

-nc or --no-copyright — by default, uglifyjs will keep the initial comment tokens in the generated code (assumed to be copyright information etc.). If you pass this it will discard it.

这也是uglifier的选项.

which is also an option of uglifier.

这篇关于Rails资产-保留许可证注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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