I have license comments in all source files and, currently, Babili is producing such an output:

What I would like to have is a single license header at the top of the entire file (possibly added by some additional Webpack plugin or something) and no other license comments.
PS. I know that doesn't matter for gzipped size, but nevertheless, those comments are unnecessary.
By default /licen(s|c)e|preserve/ comments are preserved. You can use shouldPrintComment of babel to remove all comments. http://babeljs.io/docs/usage/api/#options
Thanks.
I forgot to mention that I knew about that option. However, it's a bit inconvenient that Babili's preset doesn't configure Babel to clean up those comments because if you use Babili there's a huge chance that you don't want them.
It's not a big deal, of course, but it felt odd to me.
@boopathi I still don't understand how this to get this working?
main.js
/**
* @license
* Copyright (c) roydukkey. All rights reserved.
* Licensed under the GNU General Public License, Version 3.0.
*/
console.log('test');
main.min.js
console.log("test");
Babel Config
{
"presets": [
[ "minify" ]
]
}
@boopathi I still don't understand how this to get this working?
@roydukkey, Yeah, it's pretty simply but it's not obvious from the documentation.
Here's what I'm using:
const preserveImportant = comment => /licen[sc]e|copyright|@preserve|^!/i.test(comment);
const minifyJs = { presets: ['minify'], shouldPrintComment: preserveImportant };