@@ -11,7 +11,11 @@ function puts(error, stdout, stderr) {
1111 if ( error ) {
1212 console . log ( 'Error: ' , error , stderr ) ;
1313 }
14- console . log ( stdout ) ;
14+ }
15+
16+ function spreadStdoutAndStdErr ( proc ) {
17+ proc . stdout . pipe ( process . stdout ) ;
18+ proc . stderr . pipe ( process . stdout ) ;
1519}
1620
1721function validateInput ( options ) {
@@ -28,7 +32,7 @@ function validateInput(options) {
2832}
2933
3034function mergeOptions ( options , defaults ) {
31- for ( var key in defaults ) {
35+ for ( let key in defaults ) {
3236 if ( options . hasOwnProperty ( key ) ) {
3337 defaults [ key ] = options [ key ] ;
3438 }
@@ -50,7 +54,7 @@ export default class WebpackShellPlugin {
5054 if ( this . options . onBuildStart . length ) {
5155 console . log ( 'Executing pre-build scripts' ) ;
5256 this . options . onBuildStart . forEach ( ( script ) => {
53- exec ( script , puts ) ;
57+ spreadStdoutAndStdErr ( exec ( script , puts ) ) ;
5458 } ) ;
5559 if ( this . options . dev ) {
5660 this . options . onBuildStart = [ ] ;
@@ -62,7 +66,7 @@ export default class WebpackShellPlugin {
6266 if ( this . options . onBuildEnd . length ) {
6367 console . log ( 'Executing post-build scripts' ) ;
6468 this . options . onBuildEnd . forEach ( ( script ) => {
65- exec ( script , puts ) ;
69+ spreadStdoutAndStdErr ( exec ( script , puts ) ) ;
6670 } ) ;
6771 if ( this . options . dev ) {
6872 this . options . onBuildEnd = [ ] ;
@@ -75,7 +79,7 @@ export default class WebpackShellPlugin {
7579 if ( this . options . onBuildExit . length ) {
7680 console . log ( 'Executing additional scripts before exit' ) ;
7781 this . options . onBuildExit . forEach ( ( script ) => {
78- exec ( script , puts ) ;
82+ spreadStdoutAndStdErr ( exec ( script , puts ) ) ;
7983 } ) ;
8084 }
8185 } ) ;
0 commit comments