Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Grunt

You're reading from   Learning Grunt Monitor and automate complex JavaScript tasks and processes by obtaining a practical understanding of Grunt

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher Packt
ISBN-13 9781785888809
Length 184 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Douglas Reynolds Douglas Reynolds
Author Profile Icon Douglas Reynolds
Douglas Reynolds
Arrow right icon
View More author details
Toc

Creating a Grunt plugin


We will be using grunt-init, which is a scaffolding tool.

Using the Grunt plugin scaffold

Grunt provides you with a plugin module creation with grunt-init-gruntplugin, which will scaffold your plugin authoring environment. While using gruntplugin is not mandatory, it is recommended by the Grunt team. The gruntplugin requires grunt-init to be installed. Clone grunt-init-gruntplugin from its repository:

git clone git://github.com/gruntjs/grunt-init-gruntplugin.git ~/.grunt-init/gruntplugin.

In Windows, the destination path should be modified to %USERPROFILE%\.grunt-init\gruntplugin.

Alternatively, navigate to https://github.com/gruntjs/grunt-init-gruntplugin, where you can download the plugin files, and then place the template in your ~/.grunt-init directory. Once the template has been added, run the following from the directory where you wish to author your plugin:

cd path/to/plugin_directory
grunt-init gruntplugin

The output is as follows:

Following the illustration of...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime