The second example you have there has the asterisk *
sitting out in the open — it's not a string. That's why it reports an error.
The docs state that the default setting to to save all special comments. If you click through to clean-css
, you will see that special comments refers to comments that have an exclamation mark (!
) to note that they are important. Try changing your comment to look like this, and I bet it will retain it without any configuration at all.
/*!
put your settings here
*/
If Wordpress is incapable of working with the special comment, for some reason, then you can use gulp-replace
to correct the comment before saving it, like this:
var replace = require('gulp-replace');
// ... sass, compress-css, etc ...
.pipe(replace('/*!', '/*'))
// ... gulp.dest, etc ...
This will remove the exclamation mark from the comment. I wouldn't bother doing this unless Wordpress fails.