Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove comments using the RequireJS optimizer?

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?

like image 698
Michael Yagudaev Avatar asked Jul 24 '12 16:07

Michael Yagudaev


1 Answers

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

like image 109
Mifeng Avatar answered Nov 08 '22 21:11

Mifeng