1 grunt是什么 官方网站解释的很清楚,http:/// http:/// 它是一种javascript任务运行器,对于需要反复重复的任务,例如压缩、编译、单元测试、代码检查等,自动化工具可以减轻你的劳动,简化你的工作。 grunt的安装请参考官方文档。 2 grunt 插件开发步骤 - Install grunt-init with
npm install -g grunt-init - Install the gruntplugin template with
git clone git://github.com/gruntjs/grunt-init-gruntplugin.git ~/.grunt-init/gruntplugin - Run
grunt-init gruntplugin in an empty directory. - Run
npm install to prepare the development environment. - Author your plugin.
- 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 4,点击绿色图标,选择Node.js 其中Javascript file: 要选择grunt程序,而不是Gruntfile.js Application parameters: test,表示启动 grunt test 这个命令。 至此就可以对gurnt进行debug运行了。
|