remove comments of minified css/js in django compressor

218 Views Asked by At

I have django-compressor in my project and i use this filters for minify:

'css': [
     'compressor.filters.css_default.CssAbsoluteFilter',
     'compressor.filters.cssmin.CSSMinFilter'
 ],
 'js': [
     'compressor.filters.jsmin.JSMinFilter'
 ]

that works correctly. but this not removed license comments like:

/*!
 * example plugin v1.1.9
 *
 * Copyright 2015-present me
 * Released under the MIT license
 *
 * Date: 2020-09-10 13:16:21
 */

i searched and i found that cssmin filter has arguments that removed them. but i think django-compressor not supported it.
also i think that i can with COMPRESS_PRECOMPILER config remove this comments.

1

There are 1 best solutions below

0
On

Usually, you're not allowed to remove these comments. The MIT license in particular includes this:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

So I'd say this is "by design".