0
你好,我正试图设置一个观察者,但我得到的只是这个在控制台中。观察者在Grunt中不工作
$咕噜watchTest
运行 “监视” 任务
等待... $
所以没有实际的等待。我尝试了茉莉花任务,并按预期工作。我有我错过了什么?
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'src/main.js',
dest: 'build/<%= pkg.name %>.min.js'
}
},
jasmine : {
src : 'src/**/*.js',
options : {
specs : 'src/test/specs/**/*.js'
}
},
watch: {
src : 'src/**/*.js',
tasks: ['jasmine']
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
grunt.registerTask('default', ['uglify']);
grunt.registerTask('test', ['jasmine']);
grunt.registerTask('watchTest', ['watch']);
};
它的工作原理。谢谢! – pethel
不客气! :-) – Ben