olback / es6-css-minify

Easily minify CSS and JavaScript in VS Code
https://marketplace.visualstudio.com/items?itemName=olback.es6-css-minify
MIT License
47 stars 13 forks source link

How to keep important comments? #105

Closed fkoeppling closed 4 years ago

fkoeppling commented 4 years ago

When minifying .js files, I'd like to keep important comments like licence information and other stuff. I've searched all documentation for your extension and the documentation of the dependencies but I'm unable to find an answer for this. I'd be very happy for more insight on this matter!

I'm using JS & CSS Minifier for VScode on Windows. Thanks in advance!

fkoeppling commented 4 years ago

EDIT*

Found out by testing that this markup keeps comments: Add a exclamation mark to the start tag of a comment-block. Works with multi-line and documentation comment blocks, but not with single-line comments.

Multi-line comments:

/*! comment content */

Multi-line documentation comments:

/**! * comment content */

Apologies for opening this issue without proper testing beforehand. It wasn't this obvious to me. May this entry on Q&A help answering those wondering the same in the future.

olback commented 4 years ago

Documentation for this extension is not particularly good. I don't blame you for opening an issue. Glad you figured it out though.