Created
September 4, 2013 20:53
-
-
Save ben-eb/6442724 to your computer and use it in GitHub Desktop.
Split up the Gruntfile initConfig into individual JS files; this gist shows an example based on grunt-contrib-clean. This blog post has a more in-depth look at splitting up the Gruntfile into manageable chunks: http://www.thomasboyt.com/2013/09/01/maintainable-grunt.html
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
// .grunt/config/clean.js | |
module.exports.tempDir = ["tmp"]; |
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
module.exports = function(grunt) { | |
var conf = { | |
pkg: grunt.file.readJSON('package.json') | |
}; | |
grunt.file.recurse('./.grunt/config', function(a, r, s, f) { | |
conf[f.replace(/\.js$/, '')] = require('./' + a); | |
}); | |
grunt.initConfig(conf); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment