Created
June 26, 2014 14:57
-
-
Save robhrt7/d8ec45b39c27ade30757 to your computer and use it in GitHub Desktop.
Reading Grunt config from custom functions in Gruntfile.js for further use in config
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
/* | |
Usefull snippent for this kind of custom Grunt functions https://gist.github.com/operatino/bd857f570adaf2872c37 | |
*/ | |
module.exports = function (grunt) { | |
var baseConfig = { | |
foo: 'bar' | |
}; | |
grunt.initConfig(baseConfig); | |
var someFunc = function(){ | |
var foo = grunt.config.get('foo'); | |
}; | |
grunt.config.merge({ | |
task: { | |
some: [ | |
'<%= foo %>', | |
] | |
}, | |
otherTask: { | |
some: someFunc() | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment