Skip to content

Instantly share code, notes, and snippets.

@robhrt7
Created June 26, 2014 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robhrt7/d8ec45b39c27ade30757 to your computer and use it in GitHub Desktop.
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
/*
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