The following is a sample of gruntfile configuration for grunt sync integrates with grunt watch:
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-sync');
grunt.initConfig({
sync: {
fonts: {
files: [{
cwd: "bower_components/fontawsome/fonts",
src: ['**'],
dest: "sites/default/themes/custom/bootstrap_sub/fonts",
}], // files
verbose: true,
pretend: false,
failOnError: true,
updateAndDelete: true,
compareUsing: "md5" // Options "md5" or "mtime"
} // fonts
}, // sync
watch: {
syncfiles: {
files: [
"bower_components/fontawsome/fonts/**",
],
tasks: ['sync']
} // syncfiles
} // watch
}); // initConfig
grunt.registerTask('default', 'watch');
grunt.registerTask('prod', ['sync']);
} // exports
great reference
I wasn't able to run the sync task separately from watch. Including 'syncfiles' solved the issue. Thanks for posting.