Skip to content

Instantly share code, notes, and snippets.

@vladikoff
Last active December 20, 2015 21:19
Show Gist options
  • Select an option

  • Save vladikoff/6196873 to your computer and use it in GitHub Desktop.

Select an option

Save vladikoff/6196873 to your computer and use it in GitHub Desktop.
// watch config
watch: {
options: {
spawn: false // <--- important
},
js: {
files: '*.js',
tasks: []
}
}
// watch event
grunt.event.on('watch', function(action, filepath, target) {
grunt.config(['log'], filepath);
grunt.task.run('log');
});
// your task
grunt.registerTask('log', 'Log stuff.', function() {
var filepath = grunt.config.get('log'));
// do stuff with filepath...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment