Skip to content

Instantly share code, notes, and snippets.

@watilde
Last active December 17, 2015 21:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save watilde/5676639 to your computer and use it in GitHub Desktop.
Save watilde/5676639 to your computer and use it in GitHub Desktop.
Easy to write to load grunt plugin.
/**
* @fileOverview Easy to write to load grunt plugin.
* @author Daijiro Wachi
*/
module.exports = function(grunt) {
"use strict";
/** @type {object} pkg */
var pkg = grunt.file.readJSON("package.json");
// Load Grunt Plugins
Object.keys(pkg.devDependencies).slice(1).map(grunt.loadNpmTasks);
/* Familiar Common Sight:(
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
*/
};
/*
// e.g.) "package.json" in this Case.
{
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-watch": "~0.2.0",
"grunt-contrib-jasmine": "~0.4.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-cssmin": "~0.6.0",
"grunt-contrib-jshint": "~0.5.4"
}
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment