{"id":24819,"date":"2015-08-01T22:36:14","date_gmt":"2015-08-01T17:06:14","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=24819"},"modified":"2015-08-03T11:21:38","modified_gmt":"2015-08-03T05:51:38","slug":"how-to-use-grunt-in-existing-project","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/how-to-use-grunt-in-existing-project\/","title":{"rendered":"How to use Grunt in existing project"},"content":{"rendered":"<p>I am very glad to <a title=\"Getting Started with Grunt\" href=\"http:\/\/www.tothenew.com\/blog\/getting-started-with-grunt\/\">explain about the Grunt<\/a>, because i feel it makes my life easy.<\/p>\n<p>Always keep in mind, use your valuable time in creative activities, not in repetitive and boring tasks in web development.<\/p>\n<p>In this context, grunt is very helpful for everyone.<\/p>\n<p>So, a basic question is &#8220;What is Grunt?&#8221;<\/p>\n<p>It is a task runner. Through which you can automate your most repetitive tasks.<\/p>\n<p>For using grunt, first of all you have to install grunt-cli ( It would be more helpful if you installed grunt-cli globally in your system ). npm install -g grunt-cli<br \/>\nNote: If you don&#8217;t want to install grunt globally remove -g from given command.<\/p>\n<p>A basic example of Grunt:<\/p>\n<p>Follow these steps to configure Grunt in existing project<br \/>\n1. Install grunt ( run following command from project root directory)<\/p>\n<p>npm install -S grunt<\/p>\n<p>2. create Gruntfile.js in root directory<br \/>\n3. Write following code inside the Gruntfile.js<br \/>\nmodule.exports = function (grunt){<\/p>\n<p>grunt.registerTask(&#8216;singing&#8217;, function () {<br \/>\nconsole.log(&#8216;I am Singing&#8217;);<br \/>\n});<\/p>\n<p>grunt.registerTask(&#8216;dancing&#8217;,function(){<br \/>\nconsole.log(&#8216;I am dancing&#8217;);<br \/>\n});<\/p>\n<p>grunt.registerTask(&#8216;default&#8217;,function(){<br \/>\nconsole.log(&#8216;I am acting&#8217;);<br \/>\n});<\/p>\n<p>grunt.registerTask(&#8216;both&#8217;,[&#8216;singing&#8217;,&#8217;dancing&#8217;]);<br \/>\n}<\/p>\n<p>4. Run following command and examine the output<br \/>\ngrunt singing<br \/>\ngrunt dancing<br \/>\ngrunt both<br \/>\ngrunt<\/p>\n<p>For Reference: https:\/\/github.com\/SatyamChaudhary8891\/grunttutorial-grunt-1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am very glad to explain about the Grunt, because i feel it makes my life easy. Always keep in mind, use your valuable time in creative activities, not in repetitive and boring tasks in web development. In this context, grunt is very helpful for everyone. So, a basic question is &#8220;What is Grunt?&#8221; It [&hellip;]<\/p>\n","protected":false},"author":122,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":2},"categories":[1],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/24819"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/122"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=24819"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/24819\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=24819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=24819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=24819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}