File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
packages/vite-plugin-kirby/src Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ ${Object.entries(config)
3838 . join ( ',\n' ) }
3939];`
4040
41+ let exitHandlersBound = false
42+
4143export default (
4244 {
4345 watch = true ,
@@ -90,6 +92,19 @@ export default (
9092 writeFile ( devPath , `VITE_SERVER=${ config . server . origin } ` )
9193 } )
9294
95+ if ( ! exitHandlersBound ) {
96+ const clean = ( ) => {
97+ unlink ( devPath ) . catch ( ( _e : Error ) => { } )
98+ }
99+
100+ process . on ( 'exit' , clean )
101+ process . on ( 'SIGINT' , process . exit )
102+ process . on ( 'SIGTERM' , process . exit )
103+ process . on ( 'SIGHUP' , process . exit )
104+
105+ exitHandlersBound = true
106+ }
107+
93108 if ( watch ) {
94109 const defaultPaths = [
95110 '../site/(templates|snippets|controllers|models|layouts)/**/*.php' ,
@@ -101,8 +116,6 @@ export default (
101116 }
102117 } ,
103118
104- buildStart ( ) {
105- unlink ( devPath ) . catch ( ( _e : Error ) => { } )
106- } ,
119+ buildStart ( ) { } ,
107120 }
108121}
You can’t perform that action at this time.
0 commit comments