File tree Expand file tree Collapse file tree 2 files changed +11
-16
lines changed
vue-component-dev-client/client Expand file tree Collapse file tree 2 files changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,7 @@ exports.reload = tryWrap((id, options) => {
220220 console . warn (
221221 'Root or manually mounted instance modified. Full reload required.'
222222 )
223+ window . location . reload ( )
223224 }
224225 } )
225226} )
Original file line number Diff line number Diff line change @@ -331,22 +331,16 @@ class ComponentWatcher {
331331 }
332332
333333 _watchPath ( filePath ) {
334- if ( ! this . watcher || filePath !== this . filePath ) {
335- this . filePath = filePath
336- // Fast file change detection
337- this . _closeWatcher ( )
338- this . watcher = fs . watch ( filePath , {
339- persistent : false ,
340- } , _ . debounce ( event => {
341- if ( event === 'change' ) {
342- this . refresh ( )
343- }
344- } , 100 , {
345- leading : false ,
346- trailing : true ,
347- } ) )
348- this . watcher . on ( 'error' , ( error ) => console . error ( error ) )
349- }
334+ this . filePath = filePath
335+ // Fast file change detection
336+ this . _closeWatcher ( )
337+ this . watcher = fs . watch ( filePath , {
338+ persistent : false ,
339+ } )
340+ this . watcher . on ( 'change' , _ . debounce ( event => { // Refresh once
341+ this . refresh ( )
342+ } , 100 ) )
343+ this . watcher . on ( 'error' , ( error ) => console . error ( error ) )
350344 }
351345}
352346
You can’t perform that action at this time.
0 commit comments