@@ -131,29 +131,6 @@ if (!Object.fromEntries) {
131131 }
132132}
133133
134- // workaround for bun: https://github.com/oven-sh/bun/issues/18919
135- let fs_watch = fs . watch ;
136- if ( IS_BUN ) {
137- const fs_watch_original = fs_watch ;
138- const watch_callbacks = new Map ;
139- fs_watch = ( path , options , callback ) => {
140- if ( ! watch_callbacks . has ( path ) ) {
141- fs_watch_original ( path , options , ( ) => {
142- const callback = watch_callbacks . get ( path ) ;
143- if ( callback ) {
144- callback ( ) ;
145- }
146- } ) ;
147- }
148- watch_callbacks . set ( path , callback ) ;
149- return {
150- close : ( ) => (
151- watch_callbacks . set ( path , null )
152- ) ,
153- } ;
154- }
155- }
156-
157134// legacy, will be removed soon!
158135global . globals = rtjscomp ;
159136global . actions = rtjscomp . actions ;
@@ -378,7 +355,7 @@ const service_update = async service_object => {
378355 if ( service_object . status !== SERVICE_STATUS_PENDING ) return ;
379356 if ( ! service_object . watcher ) {
380357 let timeout = 0 ;
381- service_object . watcher = fs_watch ( path_real , WATCH_OPTIONS , ( ) => (
358+ service_object . watcher = fs . watch ( path_real , WATCH_OPTIONS , ( ) => (
382359 clearTimeout ( timeout ) ,
383360 timeout = setTimeout ( ( ) => (
384361 log_verbose && log ( 'file updated: ' + path ) ,
@@ -613,7 +590,7 @@ const service_require_try = path => {
613590}
614591
615592const file_watch_once = ( path , callback ) => {
616- const watcher = fs_watch ( path , WATCH_OPTIONS , ( ) => (
593+ const watcher = fs . watch ( path , WATCH_OPTIONS , ( ) => (
617594 watcher . close ( ) ,
618595 log_verbose && log ( 'file updated: ' + path ) ,
619596 callback ( )
@@ -631,7 +608,7 @@ const file_keep_new = async (path, callback) => {
631608 }
632609
633610 let timeout = 0 ;
634- return fs_watch ( path , WATCH_OPTIONS , ( ) => (
611+ return fs . watch ( path , WATCH_OPTIONS , ( ) => (
635612 clearTimeout ( timeout ) ,
636613 timeout = setTimeout ( ( ) => exiting || (
637614 log_verbose && log ( 'file updated: ' + path ) ,
0 commit comments