Created
October 8, 2013 09:29
-
-
Save chaosim/6882090 to your computer and use it in GitHub Desktop.
watch and run tasks only on changed files
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
grunt.event.on 'watch', (action, filepath, target) -> | |
if minimatch filepath, 'src/**/*.coffee' | |
grunt.config.set 'coffee', | |
dev: | |
expand: true | |
cwd: 'src' | |
src: filepath.slice(4) | |
dest: 'dev' | |
ext: '.js' | |
else if minimatch filepath, 'src/views/**/*.jade' | |
grunt.config.set 'jade', | |
dev: | |
options: pretty: true | |
expand: true | |
cwd: 'src/views' | |
src: filepath.slice(10) | |
dest: 'dev/public/views' | |
ext: '.html' | |
else | |
for item in copyDevFiles | |
if minimatch filepath, item[0]+'/'+item[2] | |
grunt.config.set 'copy', | |
dev: | |
expand: true | |
dot: true | |
cwd: item[0] | |
dest: item[1] | |
src: filepath.slice(item[0].length+1) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
watch and run tasks only on changed files