PHPStorm:如何设置LESS输出到文件监视器的CSS目录? [英] PHPStorm: How do I setup LESS to output to CSS directory with file watcher?

查看:955
本文介绍了PHPStorm:如何设置LESS输出到文件监视器的CSS目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用PHPStorm中的文件监视器设置LESS文件监视器输出路径以执行此操作:

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

我想要:

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

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

可输出到:

/project/path/css/dir/file.css

/project/path/css/dir/file.css

/ project / path /less/file2.less

/project/path/less/file2.less

可输出到:

/project/path/css/file2.css

/project/path/css/file2.css

我没有看到一个明确的方法使这发生在PHPstorm中的输出路径宏。使用FileDirRelativeToProjectRoot宏,我可以获得当前目录的路径,但是没有明确的方法用/ css替换路径中的/ css。

I'm not seeing a clear way to make this happen with the Output Path macros in PHPstorm. With the FileDirRelativeToProjectRoot macro, I'm able to get the path to the current directory, but there is no clear way to replace /less with /css in the path.

推荐答案

请参阅 JADE文件观察者的相关答案,我相信它会是一样的对于LESS。

See my related answer for JADE file watcher, I believe it would be the same for LESS.

诀窍是使用 $ FileDirPathFromParent(dir)$ 宏:

$ ProjectFileDir $ / css / $ FileDirPathFromParent(less)$ 将产生 / project / path / css / dir / 目录中的文件

这篇关于PHPStorm:如何设置LESS输出到文件监视器的CSS目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆