I'm still a Grunt newbie and I'm having difficulties "watching" for php files.
What happens is that the livereload works perfectly fine for any php file but any task I want to launch in regard to changes on php files simply doesn't happen... In this case i wanted to use ftp-deploy to push the ftp files to my server each time they change (this way I get to keep my workflow by linking to the php files directly on my server and using a simple MAMP installation).
My watch code goes something like this:
watch: {
concat: {
files: '<%= project.src %>/js/{,*/}*.js',
tasks: ['concat:dev', 'jshint']
},
sass: {
files: '<%= project.src %>/scss/{,*/}*.{scss,sass}',
tasks: ['sass:dev', 'cssmin:dev', 'autoprefixer:dev']
},
banana: {
files: '<%= project.src %>/php/*.php',
tasks: ['ftp-deploy']
},
livereload: {
options: {
livereload: LIVERELOAD_PORT
},
files: [
'<%= project.app %>/{,*/}*.html',
'<%= project.assets %>/css/*.css',
'<%= project.assets %>/js/{,*/}*.js',
'<%= project.src %>/php/{,*/}*.php',
'<%= project.assets %>/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
}
}
So everything works perfectly even the livereload for the php files, to the huge exception that the ftp-deploy task doesn't happen.
If I add that ftp-deploy task onto the sass target or the concat target it works perfectly but on the banana target (yeah... I started to get frustrated) it simply doesn't work at all!
I'm breaking my head with this...
Can someone help me out?
Thanks in advance.