终端中的LESS css编译器帮助 [英] LESS css compiler help in terminal

查看:182
本文介绍了终端中的LESS css编译器帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Ubuntu 13.04(Linux)
我已经安装了节点和npm。使用npm我下载少通过终端。

Im using Ubuntu 13.04 (Linux) I have installed node, and npm. With npm I downloaded less via terminal.

我使用这个在我的简单的HTML / CSS项目。纯前端。

Im using this on my simple HTML/CSS project. pure frontend. its not a Ruby or nodejs project.

当我做

lessc styles.less styles.css -x -w

并压缩代码,但不会观察文件的更改,因为我希望LESS自动编译和刷新页面。所以,如果我对styles.less做任何更改,每次我必须去终端并输入命令编译较少的CSS。

in terminal, it compiles and compresses the code, but doesn't watch the file for changes, since Im expecting LESS to auto compile and refresh the page automatically. So, if I do any changes in my styles.less, every-time I have to go to terminal and enter the command to compile the less css.

此外,即使我有意添加任何内容,编译器也不会显示任何编译错误,但在这种情况下它不会编译。

Also, the compiler does NOT even show any compile errors even if I add anything on purpose, but in that case it doesn't compiles.

我如何实现上面的。这是我第一天用LESS CSS。

Please guide me on how to achieve the above. This is my first day with LESS CSS.

推荐答案

如果你输入 lessc help 你会看到没有参数-w或--watch。您可以做的是使用像 GruntJS 这样的构建系统,并使用 grunt-contrib-watch ,并监视您的更少的文件,并建立CSS的变化。

If you type lessc help you will see that there is no argument -w or --watch. What you can do is to use a build system like GruntJS with an extension like grunt-contrib-watch and have that monitor your less files and build the css on change.

这篇关于终端中的LESS css编译器帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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