PHPStorm: How do I setup LESS to output to CSS directory with file watcher?

后端 未结 6 513
误落风尘
误落风尘 2020-12-09 09:30

How do, using File Watchers in PHPStorm do I set up LESS file watchers output path to do this:

I want:

/project/path/less/dir/file.less

to output to:

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 09:38

    I want to compile one less file from

    sites/all/themes/bic/res/less/style.less to sites/all/themes/bic/res/css/style.css

    Here's what I did

    enter image description here

    So the Arguments I used is: --no-color $FileName$ ../css/$FileNameWithoutExtension$.css

    This will produce: /usr/local/bin/lessc --no-color blogs.less ../css/blogs.css at phpstorm console, and works fine.

    I might miss something. Anyway, I tried both "--no-color $FileName$ $ProjectFileDir$/sites/all/themes/bic/res/css/$FileDirPathFromParent(less)$" and "--no-color $FileName$ $ProjectFileDir$/sites/all/themes/bic/res/css/$FileDirPathFromParent(less)$$FileNameWithoutExtension$.css". Neither of them work for me. So just post my solution here, which might help some people who has the same trouble with me..

提交回复
热议问题