diff --git a/bin/src/handleError.js b/bin/src/handleError.js index ba17d0c..243592c 100644 --- a/bin/src/handleError.js +++ b/bin/src/handleError.js @@ -42,7 +42,7 @@ const handlers = { } }; -export default function handleError ( err ) { +export default function handleError ( err, recover ) { const handler = handlers[ err && err.code ]; if ( handler ) { @@ -57,5 +57,5 @@ export default function handleError ( err ) { stderr( `Type ${chalk.cyan( 'rollup --help' )} for help, or visit https://github.com/rollup/rollup/wiki` ); - process.exit( 1 ); + if ( !recover ) process.exit( 1 ); } diff --git a/bin/src/runRollup.js b/bin/src/runRollup.js index c724b55..45c305e 100644 --- a/bin/src/runRollup.js +++ b/bin/src/runRollup.js @@ -152,6 +152,10 @@ function execute ( options, command ) { stderr( 'bundled in ' + event.duration + 'ms. Watching for changes...' ); break; + case 'ERROR': + handleError( event.error, true ); + break; + default: stderr( 'unknown event', event ); }