分享

Grunt 插件开发与调式

 鹰皇软件 2016-01-03

1 grunt是什么

官方网站解释的很清楚,http:/// http:///

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

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

2 grunt 插件开发步骤

  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调试

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

1,首先要确定安装了nodejs

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

3,工具栏Run—> Edit configrations

QQ截图20140806141759

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

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

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

 

QQ图片20140806142925

至此就可以对gurnt进行debug运行了。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多