0

I have started using less and find it great but one thing which i don't like is that the output css is compressed/minified - whole output is packed in just one line, while i need an uncompressed css output?

I am using Dead-Simple-LESS-Watch-Compiler-master.js to watch my Less directory and any change i in my less file is compiled into css file.

in my project directory i write command

node less-watch-compiler.js less_di css_dir

2
  • 1
    How exactly are you processing your .less file in the first place? Commented Jun 23, 2014 at 9:16
  • That particular script explicitly causes lessc to minify the result. Regular lessc doesn't do that by default. Commented Jun 23, 2014 at 9:35

1 Answer 1

3

If you're using Less from the command-line via lessc then the default output should be unminified.
If you want to minimize the output you'll have to pass an extra parameter, -x, see the Less homepage for more details.

If Less is built into your workflow somehow differently you'll need to check for additionally passed parameters.


The script you're referencing includes the parameter, in the function compileCSS, line 147:

var command = 'lessc -x '+file.replace(/\s+/g,'\\ ')+' '+argvs[1]+'/'+filename.replace(/\s+/g,'\\ ')+'.css';

You can either manually remove the -x from the command to receive unminified output or edit the script to accept an additional parameter (and then preferably make a pull request to the script author/maintainer).

Sign up to request clarification or add additional context in comments.

1 Comment

I am using Dead-Simple-LESS-Watch-Compiler-master.js to watch less changes to css

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.