最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do I remove comments using the RequireJS optimizer? - Stack Overflow

programmeradmin0浏览0评论

I am trying to remove copyright comments from my optimized script files. We are using RequireJS with the default UglifierJS. I looked into Uglifier which in itself has a flag called -nc or --no-comments, but it does not seem like RequireJS lets you set that option in the build profile. Is there anyway to do this?

I am trying to remove copyright comments from my optimized script files. We are using RequireJS with the default UglifierJS. I looked into Uglifier which in itself has a flag called -nc or --no-comments, but it does not seem like RequireJS lets you set that option in the build profile. Is there anyway to do this?

Share Improve this question edited Jul 24, 2012 at 18:23 hugomg 69.9k29 gold badges164 silver badges254 bronze badges asked Jul 24, 2012 at 16:59 Michael YagudaevMichael Yagudaev 6,1293 gold badges50 silver badges55 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 34

You can add the following line to your build.js file used for r.js

preserveLicenseComments: false,

Here is the full documentation: https://github.com/jrburke/r.js/blob/master/build/example.build.js#L519

发布评论

评论列表(0)

  1. 暂无评论