0

我有以下监视配置,可以重新加载页面并运行其他任务。

watch: {
            js: {
                files: ['gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**', 'test/**/*.js'],
                tasks: ['jshint'],
                options: {
                    livereload: true,
                },
            },
            html: {
                files: ['public/views/**', 'app/views/**'],
                options: {
                    livereload: true,
                },
            },
            css: {
                files: ['public/css/**'],
                options: {
                    livereload: true
                }
            },
            test: {
                files: ['app/**/*.js', 'test/mocha/**/*.js'],
                tasks: ['mochaTest', 'karma:unit']
            }
        },

我不想在监视任务中运行“测试”选项,我只想在指定时运行它,就像在我的测试任务中一样:

grunt.registerTask('test-w', ['mochaTest', 'karma:unit', 'watch:test']);

我试图在并发任务中做到这一点:

tasks: ['nodemon', 'watch:js:html:css']

不幸的是没有工作:(

4

1 回答 1

0

只需指定所有必要的监视任务concurrent

tasks : ['nodemon', 'watch:js', 'watch:html', 'watch:css']
于 2014-02-25T12:46:46.437 回答