Last active
December 17, 2015 21:39
-
-
Save watilde/5676639 to your computer and use it in GitHub Desktop.
Easy to write to load grunt plugin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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