Grunt 插件开发与调式

1 grunt是什么javascript

官方网站解释的很清楚,http://gruntjs.com/ http://gruntjs.cn/java

它是一种javascript任务运行器,对于须要反复重复的任务,例如压缩、编译、单元测试、代码检查等,自动化工具能够减轻你的劳动,简化你的工做。node

grunt的安装请参考官方文档。git

2 grunt 插件开发步骤github

  1. Install grunt-init with npm install -g grunt-init
  2. Install the gruntplugin template with git clone git://github.com/gruntjs/grunt-init-gruntplugin.git ~/.grunt-init/gruntplugin
  3. Run grunt-init gruntplugin in an empty directory.
  4. Run npm install to prepare the development environment.
  5. Author your plugin.
  6. Run npm publish to publish the Grunt plugin to npm!

3 使用webstorm调试web

WebStrom是由jetbrains开发的javascript IDE,是付费的,功能很是强大。npm

1,首先要肯定安装了nodejswebstorm

2,打开webstrom,并open上述构建好的项目目录grunt

3,工具栏Run—> Edit configrations工具

QQ截图20140806141759

4,点击绿色图标,选择Node.js

其中Javascript file: 要选择grunt程序,而不是Gruntfile.js

Application parameters: test,表示启动 grunt test 这个命令。

 

QQ图片20140806142925

至此就能够对gurnt进行debug运行了。

相关文章
相关标签/搜索