Grunt "Watch" nie chce kontynuować.
Problem: Uruchamianie zadania "obserwuj" Czekanie... Ostrzeżenie: Ścieżka musi być ciągiem znaków. Otrzymano niezdefiniowany
Oto chrząkający zegarek w Gruntfile.js:
watch: {
//Watch files for changes during "grunt serve"
main: {
options: {
livereload: true,
livereloadOnError: false,
spawn: false
},
files: [createFolderGlobs(["*.js", "*.less","*.html","*.json"]), "!src/bower_components/**/*.js", "!src/js/**/*.js", "!_SpecRunner.html","!.grunt"],
tasks: [] //all the tasks are run dynamically during the watch event handler
}
},
Odpowiedzi:
7 dla odpowiedzi № 1Znalazłem problem. Musisz uaktualnić grunt-contrib-jshint.
Miałem wersję "grunt-contrib-jshint": "~ 0.9"
zmieniono na "grunt-contrib-jshint": "^ 1.0.0"
błąd już nie istnieje!
3 dla odpowiedzi № 2
Rozgryzłem to, pisząc to pytanie.
Kiedy dodałem tagi do tego pytania, zobaczyłem tag grunt-contrib-watch i udało się: https://github.com/gruntjs/grunt-contrib-watch.
i zrobił to:
$ npm install grunt-contrib-watch --save-dev
...Teraz działa. Wysłałem go mimo to, ponieważ nie mogłem znaleźć czegoś na ten temat, gdy googlowałem.