How can I make a Grunt task fail if one of its sub tasks fail?
问题 I have a build task in grunt, which looks like this: grunt.registerTask("build", ["jshint", "uglify"]); The problem is that the uglify task runs even if the jshint task fails, how can I make the 'build' task terminate if one of it's sub tasks fails? 回答1: The default behavior in Grunt is to not run subsequent tasks if one fails. So you must be using the force option somewhere. You are either: 1 - passing --force on the command line 2 - calling grunt.option( 'force', true ); somewhere 3 - have