Question

I have installed node package manager (npm) on my windows machine and then i ran the command "npm install less -g" and went on setting up the file watcher in PhpStorm for LESS. This worked very good. I also managed to get it to put the .css files in the css folder instead of in the less folder where I have my .less files. My next step was to install yuicompressor so I ran the command "npm install yuicompressor -g". And then I set it up in PhpStorm by adding the yuicompressor for CSS, but it only creates empty .min.css files.

In the PhpStorm watcher settings I have set:

  • Program: "C:\Users\XXX\AppData\Roaming\npm\yuicompressor.cmd"
  • And ticked the box "Create output file from stdout"

I want to achieve this: .less (project_root/less) -> .css (project_root/css) -> .min.css (project_root/css)

Is there any one else that has had the same problem, I can't seem to find any solution.

Btw, I also tried to install uglify-js, but with the same result, it only creates empy .min.js files.

Some extra info, my environment variables are as follows:

  • PATH (User) = C:\Users\XXX\AppData\Roaming\npm
  • Path (System) = C:\Program Files\nodejs\
Was it helpful?

Solution

I removed the "Create output file from stdout" (from the yui CSS file watcher and left it checked on the LESS file watcher) and it seemed to work. But I had to link to the yuicompressor.cmd and not the .jar file as mentioned in the links from LazyOne. I also had to uncheck the "Immediate file synchronization" on the LESS file watcher but needed it to be checked on the yui CSS file watcher.

The LESS file watcher

The yui CSS file watcher

Seems like its very tricky to get it to go from "LESS -> CSS -> CSS compressed" with only saving the .less file when editing, but with this setup it finally worked.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top