File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,11 +106,6 @@ function watchTask(out, build) {
106106
107107function monacodtsTask ( out , isWatch ) {
108108
109- var filesToWatchMap = { } ;
110- monacodts . getFilesToWatch ( out ) . forEach ( function ( filePath ) {
111- filesToWatchMap [ path . normalize ( filePath ) ] = true ;
112- } ) ;
113-
114109 var timer = - 1 ;
115110
116111 var runSoon = function ( howSoon ) {
@@ -144,23 +139,32 @@ function monacodtsTask(out, isWatch) {
144139 } ;
145140
146141 if ( isWatch ) {
142+
143+ var filesToWatchMap = { } ;
144+ monacodts . getFilesToWatch ( out ) . forEach ( function ( filePath ) {
145+ filesToWatchMap [ path . normalize ( filePath ) ] = true ;
146+ } ) ;
147+
147148 watch ( 'build/monaco/*' ) . pipe ( es . through ( function ( ) {
148- runSoon ( 500 ) ;
149+ runSoon ( 5000 ) ;
149150 } ) ) ;
150- }
151151
152- var resultStream = es . through ( function ( data ) {
153- var filePath = path . normalize ( data . path ) ;
154- if ( isWatch && filesToWatchMap [ filePath ] ) {
155- runSoon ( 5000 ) ;
156- }
157- this . emit ( 'data' , data ) ;
158- } , function ( end ) {
159- runNow ( ) ;
160- this . emit ( 'end' ) ;
161- } ) ;
152+ return es . through ( function ( data ) {
153+ var filePath = path . normalize ( data . path ) ;
154+ if ( filesToWatchMap [ filePath ] ) {
155+ runSoon ( 5000 ) ;
156+ }
157+ this . emit ( 'data' , data ) ;
158+ } ) ;
159+
160+ } else {
162161
163- return resultStream ;
162+ return es . through ( null , function ( end ) {
163+ runNow ( ) ;
164+ this . emit ( 'end' ) ;
165+ } ) ;
166+
167+ }
164168}
165169
166170// Fast compile for development time
You can’t perform that action at this time.
0 commit comments