Is there a way to create silent multiline comments in LESS? I want same behaviour as //comment, but for multiline strings.
相关问题
- Using XPath to access comments a flat hierachy
- calc() with variables not possible - SyntaxError:
- less.modifyVars not updating LESS variable
- Lesscss > bootstrap's darken() and lighten() d
- LESS - Assign mixin to variable and reuse
相关文章
- less css using last-child selector
- Can the Pluggable Annotation Processor API retriev
- How to assign multiple lines string in Powershell
- Can Web Essentials be configured to NOT add *.css
- Insert HTML comments in React
- Old Code in comments [closed]
- Write # in yaml (in the string)
- facebook xid doesn't work
As already made clear by @harry the
-x
andclean-css
options remove comments too. Since version 2 the clean-css option has been moved into a plugin (npm install -g less-plugin-clean-css
).Since Less 2 you can use plugins, see also http://lesscss.org/usage/#plugins ,so you can write and use a plugin which removes your multiline comments.
Example:
Download and unzip clean-css into your working directory. You can find clean-css at https://github.com/jakubpawlowicz/clean-css (this will create a sub older called clean-css-master)
Than create your plugin, call this file
less-plugin-remove-comments.js
:Your
comment-processor.js
than could contain the following:And finally you should be able to run the following command:
The preceding command should give you the compiled CSS without comments.