@@ -12,7 +12,7 @@ module.exports = (gulp, $, options) => {
1212 const _ = require ( 'lodash' ) ;
1313 const glob = require ( 'globby' ) ;
1414 const through = require ( 'through2' ) ;
15- const { map } = require ( './lib/plugins' ) ;
15+ const { map, getNotifier } = require ( './lib/plugins' ) ;
1616 const rendererCreator = require ( './lib/renderers' ) ;
1717
1818 const baseData = { } ;
@@ -70,6 +70,7 @@ module.exports = (gulp, $, options) => {
7070 return ( ) => {
7171
7272 const htmlFilter = $ . filter ( `**/${ viewmatch } ` , { restore : true } ) ;
73+ const { notify, errorHandler } = getNotifier ( options ) ;
7374
7475 const data = glob . sync ( '{,*/}*.json' , { cwd : fixturesPath } ) . reduce ( ( obj , filename ) => {
7576 const id = _ . camelCase ( filename . toLowerCase ( ) . replace ( '.json' , '' ) ) ;
@@ -78,9 +79,7 @@ module.exports = (gulp, $, options) => {
7879 } , { } ) ;
7980
8081 return gulp . src ( [ `${ viewPath } /{,*/}${ viewmatch } ` , `!${ viewPath } /{,*/}_*.*` ] )
81- . pipe ( $ . plumber ( {
82- errorHandler : $ . notify . onError ( 'Error: <%= error.message %>' )
83- } ) )
82+ . pipe ( $ . plumber ( { errorHandler } ) )
8483 . pipe ( map ( ( code , filepath ) => {
8584 const engine = renderer . match ( filepath ) ;
8685 if ( engine ) {
@@ -97,6 +96,6 @@ module.exports = (gulp, $, options) => {
9796 . pipe ( htmlFilter . restore )
9897 . pipe ( $ . if ( production , $ . rev . manifest ( paths . toPath ( 'dist.root/dist.revmap' ) , { merge : true } ) ) )
9998 . pipe ( $ . if ( production , gulp . dest ( '.' ) ) )
100- . pipe ( $ . if ( options . isWatching , $ . notify ( { message : 'Views rendered' , onLast : true } ) ) ) ;
99+ . pipe ( notify ( { message : 'Views rendered' , onLast : true } ) ) ;
101100 } ;
102101} ;
0 commit comments