Skip to content

TS/JS file watchers watch too many files #965

@dummdidumm

Description

@dummdidumm

Describe the bug
The watcher in extension.ts and the fallbackwatcher in FallbackWatcher.ts both watch too many files. They ignore node_modules, but they do not ignore build output directories. This means for example for Sapper that any changes in __sapper__ are watched and the TS plugin adds them to the list of known files, which is wrong.

To Reproduce
Start a Sapper project, change files and force rebuilds, see the number of files increase over time.

Expected behavior
Build directories are ignored

This could be done on a best-effor basis by

  • always ignoring __sapper__ and .svelte (SvelteKit)
  • try to read a .gitignore file in the root of the opened workspace and ignore file changes in all those listed paths

I'm not sure we can completely transform this into a glob though, because the glob DSL is very limited. We might need to watch all files either way but filter out the events that come from the watcher based on the .gitignore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions