-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
Support file globs with --watch-path #45182
Copy link
Copy link
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.never-staleMark issue so that it is never considered staleMark issue so that it is never considered stalewatch-modeIssues and PRs related to watch modeIssues and PRs related to watch mode
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.never-staleMark issue so that it is never considered staleMark issue so that it is never considered stalewatch-modeIssues and PRs related to watch modeIssues and PRs related to watch mode
Type
Projects
Status
Triaged
What is the problem this feature will solve?
The new experimental watch feature is awesome, but sometimes apps depend on non-imported files or data. For example, if your app has a set of templates that are read/cached at server start, updating an HTML file won't restart the process.
What is the feature you are proposing to solve the problem?
It would be extremely useful to provide an optional list of file globs that would also trigger a process restart. For example:
Note: this syntax is just to illustrate the idea.
What alternatives have you considered?
Some template engines/libraries have caching logic built in so it's disabled during local development, but supporting this in a more generic way would open up a lot of additional use cases without having to explicitly code against
NODE_ENVor enabling/disabling caching. Since the watch feature already seems to do exactly what would be needed to make this work, it would simply have to accept an optional glob or list of globs to also watch along with any imports.