@@ -235,6 +235,7 @@ module.exports = function(input, map) {
235235
236236 webpack . cacheable ( ) ;
237237
238+ var emitter = config . emitError ? webpack . emitError : webpack . emitWarning ;
238239 var engine = engines [ configHash ] ;
239240 var resourcePath = webpack . resourcePath ;
240241 var cwd = process . cwd ( ) ;
@@ -255,7 +256,7 @@ module.exports = function(input, map) {
255256 options : config ,
256257 source : input ,
257258 transform : function ( ) {
258- return lint ( engine , input , resourcePath ) ;
259+ return lint ( engine , input , resourcePath , emitter ) ;
259260 }
260261 } ,
261262 function ( err , res ) {
@@ -276,10 +277,20 @@ module.exports = function(input, map) {
276277 }
277278 ) ;
278279 }
279- printLinterOutput ( lint ( engine , input , resourcePath ) , config , webpack ) ;
280+ printLinterOutput (
281+ lint ( engine , input , resourcePath , emitter ) ,
282+ config ,
283+ webpack
284+ ) ;
280285 webpack . callback ( null , input , map ) ;
281286} ;
282287
283- function lint ( engine , input , resourcePath ) {
284- return engine . executeOnText ( input , resourcePath , true ) ;
288+ function lint ( engine , input , resourcePath , emitter ) {
289+ try {
290+ return engine . executeOnText ( input , resourcePath , true ) ;
291+ } catch ( _ ) {
292+ if ( emitter ) emitter ( _ ) ;
293+
294+ return { src : input } ;
295+ }
285296}
0 commit comments