Support file globs with `--watch-path`
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 122k
- Forks
- 37.3k
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 283
Beschreibung
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:
# current
$ node --watch app.mjs
# proposed
$ node --watch app.mjs views/*.html
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_ENV or 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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Es werden keine Implementierungsdateien oder Tests genannt. Beginne damit, den vorhandenen Befehl --watch und die Art und Weise zu prüfen, wie er importierte Dateien verfolgt; lege fest, wie optionale Glob-Argumente geparst und überwacht werden sollen. Als erledigt gilt die Aufgabe, wenn passende nicht importierte Dateien wie views/*.html neben Änderungen an importierten Dateien einen Neustart des Prozesses auslösen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, node.js
- Bereich
- cli
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100