Skip to content

Watcher is still initialized for files that are ignored #121

@puchm

Description

@puchm

Hi,
I noticed that --exclude is far superior to --ignore in terms of startup performance. This is the startup command I used:

babel-watch --use-polling --watch /app --ignore node_modules --extensions .ts,.graphql src/main.ts

It all works once it starts up but it always takes about a minute to do so. I tried switching --ignore node_modules to --exclude /app/node_modules (which is the absolute path to my node_modules folder) and this improved it to about 10 seconds.

I looked into the source code and I think I know what is going on:

The watcher gets started on all files except what's inside --exclude (see this line). I think anything that matches --ignore should also be excluded. This way it wont start watchers on the whole node_modules folder if the user makes use of --ignore instead of --exclude.

If that is not possible it should be communicated clearly in the readme that --exclude is better in terms of startup performance and what is the difference between --exclude and --ignore (to be honest, I don't fully understand it).
Also, the node_modules folder should be the default for the --exclude option rather than the --ignore option.

Thank you for improving this in advance!
Moritz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions