...in my babel.config.js which obviously, as expected, removes all comments.
What I want to do is keep 'loud' comments, i.e. comments that start with /*! rather than just /* or //.
I know Sass/Scss allows this functionality but I've done some digging around and it looks as though Babel doesn't support it.
To Reproduce
Minimal code to reproduce the bug
/*!
here is my loud comment
here is some more stuff to comment
*/
//here is a single-line comment
/*
here is a multi-line comment
*/
Actual Output
Expected Output
/*!
here is my loud comment
here is some more stuff to comment
*/
Describe the bug
I'm setting
...in my
babel.config.js
which obviously, as expected, removes all comments.What I want to do is keep 'loud' comments, i.e. comments that start with
/*!
rather than just/*
or//
. I know Sass/Scss allows this functionality but I've done some digging around and it looks as though Babel doesn't support it.To Reproduce
Minimal code to reproduce the bug
Actual Output
Expected Output
Configuration
Possible solution
I'd suggest being able to specify which types of comments shouldn't be stripped out. If no value is passed, then all comments should be removed.
For example, all comments would be removed here:
All comments except for loud comments will be removed:
Only single-line comments will be removed: