File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ import readline from 'readline'
66const query = new URLSearchParams ( import . meta. url . split ( '?' ) [ 1 ] )
77const debug = query . has ( 'debug' )
88
9+ /** The log will display on the next screen */
10+ function clearConsole ( ) {
11+ const blank = '\n' . repeat ( process . stdout . rows )
12+ console . log ( blank )
13+ readline . cursorTo ( process . stdout , 0 , 0 )
14+ readline . clearScreenDown ( process . stdout )
15+ }
16+
917/**
1018 * @type {(server: import('vite').ViteDevServer) => Promise<import('rollup').RollupWatcher> }
1119 */
@@ -25,6 +33,7 @@ function watchMain(server) {
2533 const startElectron = {
2634 name : 'electron-main-watcher' ,
2735 writeBundle ( ) {
36+ clearConsole ( )
2837 electronProcess && electronProcess . kill ( )
2938 electronProcess = spawn ( electron , [ '.' ] , { stdio : 'inherit' , env } )
3039 } ,
@@ -50,6 +59,7 @@ function watchPreload(server) {
5059 plugins : [ {
5160 name : 'electron-preload-watcher' ,
5261 writeBundle ( ) {
62+ clearConsole ( )
5363 server . ws . send ( { type : 'full-reload' } )
5464 } ,
5565 } ] ,
You can’t perform that action at this time.
0 commit comments