Intellij IDEA 11:如何从 .less 编译 .css?
如何在 intellij 中从 .less 编译 .css ?当然这应该很容易,但它让我难住了。有人知道该怎么做吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何在 intellij 中从 .less 编译 .css ?当然这应该很容易,但它让我难住了。有人知道该怎么做吗?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
我写了一个 LESS 编译器插件,每当 LESS 文件出现时,它会自动将 LESS 文件编译为 CSS改变。
您可以配置多个 LESS 目录来监视每个项目,每个目录的输出将被复制到您指定的一个或多个输出 CSS 目录:
您可以使用设置对话框中的路径模式包含/排除特定文件。
它还会检测您何时移动、复制或删除监视的 LESS 文件,并提议对相应的 CSS 文件执行相同的操作。
该插件是开源的,因此您可以在 GitHub 上查看并派生源代码(如果您愿意)喜欢。
I wrote a LESS Compiler plugin that automatically compiles LESS files to CSS whenever they change.
You can configure multiple LESS directories to watch per project, and the output of each will be copied to one or more output CSS directories that you specify:
You can include / exclude specific files by using path patterns in the settings dialog.
It will also detect when you move, copy, or delete a watched LESS file and offer to perform the same operation on the corresponding CSS file(s).
The plugin is open source, so you can view and fork the source code on GitHub if you like.
要使用 File Watchers 在 IDEA 12 中编译 LESS:
从 IDEA 中安装 File Watchers 扩展。转到设置>; IDE设置>插件。
接下来,您需要一个转码器,它包含在node.js的LESS包中
从node.js rel="noreferrer">http://nodejs.org/
在命令行中,键入 npm install -g less 以安装 LESS 包。
然后您可以在设置>下创建一个观察者。项目设置>文件观察者。选择 LESS 模板,它会自动找到您的转码器。
To use File Watchers to compile LESS in IDEA 12:
Install File Watchers extension from within IDEA. Go to Settings > IDE Settings > Plugins.
Next you need a transcoder, which is included in the LESS package for node.js
Install node.js from http://nodejs.org/
From the command line, type npm install -g less to install the LESS package.
Then you can create a watcher under Settings > Project Settings > File Watchers. Choose the LESS template and it will find your transcoder automatically.
IntelliJ IDEA 依赖 Web 框架和第三方部署工具来执行此任务。有一个在内部执行此类编译的功能请求,请随意投票。
IntelliJ IDEA relies on web frameworks and third-party deployment tools to perform this task. There is a feature request to perform such compilation internally, feel free to vote.
我知道这个问题是针对 IntelliJ IDEA 11 的,但是如果您在搜索 v12 时找到了此页面,那么有一个比 LESS 编译器插件更好的选项(这是一个很棒的插件 - 非常感谢它,Andy! )。
这是一个名为 File Watchers 的插件,由 JetBrains 团队制作。它与 WebStorm 6 和 PhpStorm 6 捆绑在一起,但您必须下载并安装其他 JetBrians IDE。步骤:
设置->插件 ->浏览存储库(底部按钮)->搜索“文件观察者”->选择文件观察器->点击顶部的下载图标 ->关闭->好的有关
JetBrains 博客。
I know this question is for IntelliJ IDEA 11, but if you found this page even though you're searching for v12, there's an option better than the LESS compiler plugin (which was a great plugin -- thanks a lot for it, Andy!).
It's a plugin called File Watchers, made by the JetBrains team. It comes bundled with WebStorm 6 and PhpStorm 6, but you have to download and install for the other JetBrians IDEs. Steps:
Settings -> Plugins -> Browse repositories (button at the bottom) -> search for "file watchers" -> select File Watchers -> click download icon at top -> Close -> OK
More info on JetBrains blog.
您可以使用以下参数设置文件观察器:
You can set a File Watcher with the following parameters: