I have a little big problem with BrowserSync version for Grunt.
PROBLEM: If I edit .php files - BrowserSync work good but if I edited .less files, nothing happened but in bash I can still see:
[BS] File changed: d:\localhost\htdocs\www\wordpress\wp-content\themes\MYPROJECTNAME\css\main.css
Can somebody please help me to setup correctly: GRUNT + LESS + BrowserSync running on XAMPP (because of WordPress)?
My gruntfile.js
module.exports = function (grunt) {
grunt.initConfig({
// Watch task config
watch: {
less: {
files: ['less/**/*.less'],
tasks: ['less']
}
},
// less task config
less: {
dev: {
files: {
"/localhost/htdocs/www/wordpress/wp-content/themes/MYPROJECTNAME/css/main.css" // destination
:
"less/main.less" // source file
}
}
},
// Using the BrowserSync Proxy for your existing website url.
browserSync : {
dev : {
bsFiles : {
src : [
'/localhost/htdocs/www/wordpress/wp-content/themes/MYPROJECTNAME/**/*.php',
'/localhost/htdocs/www/wordpress/wp-content/themes/MYPROJECTNAME/images/*.*',
'/localhost/htdocs/www/wordpress/wp-content/themes/MYPROJECTNAME/_dev/less/**/*.less',
'/localhost/htdocs/www/wordpress/wp-content/themes/MYPROJECTNAME/**/*.css',
]
},
options : {
watchTask: true,
debugInfoě: true,
logConnections: true,
notify: true,
proxy: "localhost/www/wordpress",
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-browser-sync');
// register a default task.
grunt.registerTask('default', ['less', 'browserSync', 'watch']);
};
Thanks all! :-)