を使用して変更したときに、Grunt に js ファイルをリロードさせようとしていますgrunt-contrib-watch
。これが私のものGruntfile
です:
module.exports = function(grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
connect: {
all: {
options:{
port: 9000,
hostname: "0.0.0.0",
base: 'app',
keepalive: true,
middleware: function(connect, options) {
return [
require('grunt-contrib-livereload/lib/utils').livereloadSnippet,
connect.static(options.base)
];
}
}
}
},
open: {
all: {
path: 'http://localhost:<%= connect.all.options.port%>'
}
},
watch: {
options: {
livereload: true
},
js: {
files: ['app/js/**/*.js'],
tasks: ['jshint'],
}
}
});
// Creates the `server` task
grunt.registerTask('server',[
'open',
'livereload-start',
'connect',
'watch'
]);
};
js ファイルを変更しても何も起こりません。どんな助けでも素晴らしいでしょう。