Created
June 26, 2014 21:44
-
-
Save fatso83/73875acd1fa3662ef360 to your computer and use it in GitHub Desktop.
Grunt file that shows how dynamic config (and option!) values are not used in the grunt-contrib-concat task, but picked up by other tasks
This file contains hidden or 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
my first file - used for concatenating |
This file contains hidden or 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
my second file - used for concatenating |
This file contains hidden or 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 file that shows how dynamic config (and option!) values | |
// are not used in the grunt-contrib-concat task. Run using 'grunt' | |
module.exports = function(grunt){ | |
grunt.initConfig({ | |
concat : { | |
foo : { | |
src: '<%= grunt.config.get("myfiles") %>', | |
dest : 'outfile.txt' | |
} | |
}, | |
myTask : { | |
bar : '<%= grunt.config.get("myfiles") %>' | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
grunt.registerMultiTask('myTask', function() { | |
grunt.log.writeln('myTask:' + this.target + ' data=' + this.data); | |
}); | |
grunt.registerTask('default', ['myTask','concat']); | |
grunt.config.set('myfiles',['file1.txt', 'file2.txt']) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The values set by grunt.config.set() are available for use, but seem not to be picked up by the concat task for some reason. You can see them being output by the
myTask
task.