Recently delving into Grunt, I've encountered some issues with the watch feature. While my tasks work fine when run directly from the CLI, the watch command seems to be causing trouble. Could there be any problems with my current Gruntfile setup?
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
files: '<%= uglify.build.src %>',
tasks: 'uglify',
},
uglify: {
build: {
src: ['wp-content/themes/custom/js/live/*.js', 'wp-content/themes/custom/js/waypoints/*.js', 'wp-content/themes/custom/js/*.js'],
dest: 'wp-content/themes/custom/js/test.js'
}
},
jshint: {
src: ['Gruntfile.js', 'wp-content/themes/custom/js/*.js'],
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
browser: true,
globals: {
require: true,
define: true,
requirejs: true,
describe: true,
expect: true,
it: true
}
}
}
});
// Load tasks
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task
grunt.registerTask('default', 'uglify');
};