guard / listen

The Listen gem listens to file modifications and notifies you about the changes.
https://rubygems.org/gems/listen
MIT License
1.92k stars 246 forks source link

when have node_modules dir will make the listen stuck in Record.build() #458

Closed WoolenWang closed 3 years ago

WoolenWang commented 5 years ago

when my project has a node_modules dir which have many sub directory auto generate by npm (like 1K npm pkg)

this will make the guard stuck in listen

https://github.com/guard/listen/blob/8d85b4cd5788592799adea61af14a29bf2895d87/lib/listen/adapter/base.rb#L75

@snapshots.values.each do |snapshot| _timed('Record.build()') { snapshot.record.build } end

when i debug follow to the code

it stuck go's here https://github.com/guard/listen/blob/8d85b4cd5788592799adea61af14a29bf2895d87/lib/listen/record.rb#L68

repeat run _fast_build_dir and not stop.... for over 5 minute.

the time is unacceptable.

add ignore config to exclude node_modules is not help.

change DEFAULT_IGNORED_DIRECTORIES to add like DEFAULT_IGNORED_DIRECTORIES = %r{^(?: \.git | \.svn | \.hg | \.rbx | \.bundle | bundle | node_modules | vendor/bundle | log | tmp |vendor/ruby )(/|$)}x is not help to

WoolenWang commented 5 years ago

i fix this in my own environment , with this pull request

https://github.com/guard/listen/pull/459

ColinDKelley commented 3 years ago

Closing this issue since the corresponding PR was also closed.