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?
1 Answer
Reset to default 34You 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