Search code examples
lessphpstorm

Configure Less with PhpStorm doesn't compile


I am trying to compile my styles.less to styles.css. My folder structure is following:

assets->less->styles.less
assets->css->styles.css

I believe my configurations are wrong. In PhpStorm I set less output path to refresh: ../css/$FileNameWithoutExtension$.css

I do have a styles.css file under the less file and it is compiling. So far I only know regular CSS so I'm not very familiar with Less yet. Any help?

enter image description here


Solution

  • Your File Watcher setup is incomplete.

    Right now it will save the generated file next to the source... but you need it 2 folders up.

    You did set up correctly in Output paths to refresh .. but that file tells IDE what file to check when file watcher is finished running. It is not where the generated file will be placed.

    You need to alter your Arguments field.

    • Currently you have ... $FileName$ $FileNameWithoutExtension$.css ...
    • You need to adjust the path there -- it has to be ... $FileName$ ../../css/$FileNameWithoutExtension$.css ... -- because that's where you specify such path.

    (leading and trailing "..." means other parameters that you have got there)