Last Updated: February 25, 2016
·
866
· irakli

Load All Grunt Tasks

In your Gruntfile.js you can load all grunt- modules with one command and save yourself the trouble of writing grunt.loadNpmTasks for every grunt plugin, which can results in dozens of similar lines that need to be maintained in sync between your Gruntfile.js and package.json.

module.exports = function (grunt) {
  // load all grunt tasks
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside