gruntjs / grunt-contrib-requirejs

Optimize RequireJS projects using r.js.
http://gruntjs.com/
MIT License
504 stars 105 forks source link

Grunt crash on syntax error parser #82

Closed ssavajols closed 10 years ago

ssavajols commented 10 years ago

Hi,

Is it possible to not crash grunt on syntax error during the compilation ?

It's not really comfortable to re-launch grunt every time we save a file with syntax error in it.

A "force" option could be helpful to prevent grunt exit.

Error: Parse error using esprima for file
sindresorhus commented 10 years ago

No, failing on unhandled error is normal behaviour of any program. If you're using grunt-contrib-watch there's an option to make it not exit on failure.

Blasz commented 9 years ago

That option for grunt-contrib-watch only handles grunt.fatal and grunt.warn, unhandled errors aren't going to be caught.

The issue is that any errors that are thrown by requirejs are not being caught. This grunt plugin should be catching these errors and calling grunt.fail instead of not handling them at all.

This plugin is supposed to make requirejs compatible with grunt. Catching errors and interfacing them with grunt's fail API should be a part of that process.