telling uglify to keep certain comments (using CodeKit)

There's convention to put an exclamation mark right after the comment, to preserve it after minifying. you should use something like this:

/*!
  this comment will not be removed by minifiers
 */

The above answer is not valid anymore! things evolve!

Now you should add either @preserve or @license to the comment as mentioned by @texelate below.


You need to add either @preserve or @license to the comments you want to keep. It doesn't honour /*!


You can use this way: --comments '/foo|bar/' : will keep only comments that contain "foo" or "bar". See more : https://github.com/mishoo/UglifyJS2#keeping-copyright-notices-or-other-comments