javascript 压缩 gulp-uglify 保留一个注释信息
天蓬老师
天蓬老师 2017-04-11 10:42:28
[JavaScript讨论组]

在使用 gulp-uglify 压缩后 ,

想保留 一下注释

/*! 

...
  */
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

全部回复(1)
PHPz

preserveComments

A convenience option for options.output.comments. Defaults to preserving no comments.

all
Preserve all comments in code blocks

license
Attempts to preserve comments that likely contain licensing information, even if the comment does not have directives such as @license or /*!.

Implemented via the uglify-save-license module, this option preserves a comment if one of the following is true:

The comment is in the first line of a file
A regular expression matches the string of the comment. For example: MIT, @license, or Copyright.
There is a comment at the previous line, and it matches 1, 2, or 3.

function
Specify your own comment preservation function. You will be passed the current node and the current comment and are expected to return either true or false.

some (deprecated)
Preserve comments that start with a bang (!) or include a Closure Compiler directive (@preserve, @license, @cc_on). Deprecated in favor of the license option, documented above.

https://www.npmjs.com/package/gulp-uglify

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号