Running Prebuilt Tasks with Grunt

Common tasks such as concatenation, minification, and linting are built-in and are available to use as plugins. Note that the officially maintained plugins start with grunt-contrib on the website. Do explore this!

Install the plugin

The next step is to install the plugin via the command: npm install grunt-contrib-plugin-name --save-dev.

Remember minifying? We will try running a minification task with Grunt in this lesson. To follow along, run the command npm install grunt-contrib-uglify --save-dev in the runnable environment below.

Check package.json

Now that the minification plugin, grunt-contrib-uglify has been installed, check for it in the package.json file by running a quick cat package.json. The output should look like:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.