简体   繁体   English

如何将GruntJS与Netbeans 7.3集成?

[英]How to integrate GruntJS with Netbeans 7.3?

How do I integrate Grunt into Netbeans 7.3, or alternatively allow Netbeans define some external script/program to exec as part of a build. 如何将Grunt集成到Netbeans 7.3中,或者允许Netbeans定义一些外部脚本/程序作为构建的一部分执行。

This is so I can setup Netbeans to compile Less into CSS automatically. 这样我就可以设置Netbeans自动将Less编译成CSS。

You don't have to change anything in Netbeans. 您不必在Netbeans中进行任何更改。

You should only use the Grunt to compile LESS into CSS, minify your scripts, etc. 您应该只使用Grunt将LESS编译为CSS,缩小脚本等。

Grunt will run in the background and will compile your LESS files into CSS files whenever you make any changes in this files. Grunt将在后台运行,并且只要您对此文件进行任何更改,就会将LESS文件编译为CSS文件。

  1. Install Node.js (Grunt is running on node.js) https://nodejs.org/en/download/package-manager/ 安装Node.js(Grunt在node.js上运行) https://nodejs.org/en/download/package-manager/

  2. Install Grunt http://gruntjs.com/getting-started 安装Grunt http://gruntjs.com/getting-started

  3. On grunt webpage go to plugins subpage and install: 在grunt网页上转到插件子页面并安装:

    • grunt-contrib-watch 咕噜-的contrib手表

    • grunt-contrib-less 咕噜-的contrib少

On each plugins subpage you have exact instructions how to set them up. 在每个插件子页面上,您都有准确的说明如何设置它们。

您可以使用java从less转换为css.Or为什么需要在NetBeans中进行配置?您可以创建一个grunt任务,使用终端调用它,任务将转换您需要的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM