@@ -46,7 +46,7 @@ function launch(ops) {
46
46
const deleteRequireCache = {
47
47
[ initial ] : false ,
48
48
}
49
- options . deleteRequireCache . forEach ( ( m ) => ( deleteRequireCache [ m ] = true ) )
49
+ options . deleteRequireCache . forEach ( m => ( deleteRequireCache [ m ] = true ) )
50
50
process . on ( 'exit' , ( ) => child && child . kill ( ) )
51
51
52
52
function done ( codeOrError , signal ) {
@@ -85,35 +85,10 @@ function launch(ops) {
85
85
interval : options . interval || 100 ,
86
86
binaryInterval : options . binaryInterval || 300 ,
87
87
} )
88
- << < << << HEAD
89
- watcher . on ( 'change' , function ( file ) {
90
- if ( deleteRequireCache [ file ] ) {
91
- console . log (
92
- chalk . bold . red ( '[smart-restart]' ) ,
93
- 'File' ,
94
- path . relative ( process . cwd ( ) , file ) ,
95
- 'has changed, clearing require cache.'
96
- )
97
- for ( let key in deleteRequireCache ) {
98
- if ( deleteRequireCache [ key ] ) {
99
- delete require . cache [ key ]
100
- }
101
- }
102
- return
103
- }
104
- console . log (
105
- chalk . bold . red ( '[smart-restart]' ) ,
106
- 'File' ,
107
- path . relative ( process . cwd ( ) , file ) ,
108
- 'has changed, reloading.'
109
- )
110
- restart ( )
111
- === = ===
112
88
watcher . on ( 'change' , function ( file ) {
113
89
log ( 'File' , path . relative ( process . cwd ( ) , file ) , 'has changed' )
114
90
if ( deleteRequireCache [ file ] ) clearRequireCacheSoon ( )
115
91
else restartSoon ( )
116
- >>> > >>> 962352 e ( fix : multiple issues )
117
92
} )
118
93
119
94
const args = [
@@ -136,7 +111,7 @@ function launch(ops) {
136
111
child . on ( 'error' , done )
137
112
138
113
debug ( 'spawned child pid: ' , child . pid )
139
- child . on ( 'message' , ( message ) => {
114
+ child . on ( 'message' , message => {
140
115
debug ( 'message received' )
141
116
const { status, file, parent, err, exit } = message
142
117
if ( exit != null ) {
@@ -145,7 +120,7 @@ function launch(ops) {
145
120
}
146
121
if ( status === 'ready' ) {
147
122
debug ( 'sending message:' , options )
148
- child . send ( options , ( error ) => {
123
+ child . send ( options , error => {
149
124
if ( error ) debug ( error . stack )
150
125
} )
151
126
return
0 commit comments