How do you make grunt.js not crash on warnings by default?

后端 未结 2 1106
别跟我提以往
别跟我提以往 2021-02-07 04:37

I\'m using Grunt to compile CoffeeScript and Stylus with a watch task. I also have my editor (SublimeText) set to save files every time I page away from them (I hate losing work

2条回答
  •  粉色の甜心
    2021-02-07 05:13

    Register your own task, which will run the tasks you want. Then you have to pass the force option:

    grunt.registerTask('myTask', 'runs my tasks', function () {
        var tasks = ['task1', ..., 'watch'];
    
        // Use the force option for all tasks declared in the previous line
        grunt.option('force', true);
        grunt.task.run(tasks);
    });
    

提交回复
热议问题