Remove LESS // comments on compile

bigdaveygeorge picture bigdaveygeorge · Jan 3, 2014 · Viewed 17.7k times · Source

Is it possible to configure LESS to remove "// comments" when it compiles via JS?

I want to remove them from the outputted less file.

Answer

RaphaelDDL picture RaphaelDDL · Jan 3, 2014

Less' single-line comments // are supposed to be silent, as per documentation states:

Single-line comments are also valid in LESS, but they are ‘silent’, they don’t show up in the compiled CSS output:

// Hi, I'm a silent comment, I won't show up in your CSS
.class { color: white }

See at LESS' website: http://lesscss.org/#-comments

-x flag works on command line to output minified CSS (which will strip CSS comments), but in any way, double slash shouldn't appear on css. See http://lesscss.org/#usage at 'Command-line usage' topic.