chore: update optional deps (ws & node-watch)
Updates node-watch dep to ^0.7.1 which is a breaking change in the interface of watch function for compatibility on certain windows systems that don't give event and filename info. Also updates ws dep to v^7.4.3, minor version and bug fixes.
This commit is contained in:
parent
b4fb973fc5
commit
cccea423d9
3 changed files with 18 additions and 14 deletions
|
|
@ -209,7 +209,7 @@ const startWebSocketServer = async (
|
|||
|
||||
const watchFolders = async (
|
||||
folders: string[],
|
||||
listener: (eventType: "update" | "remove", fileName: string) => void,
|
||||
listener: (eventType?: "update" | "remove", fileName?: string) => void,
|
||||
): Promise<void> => {
|
||||
// Try to load node-watch, falling back to fs watch if node-watch isn't
|
||||
// available.
|
||||
|
|
@ -282,7 +282,11 @@ const devCommand: Command = {
|
|||
existsSync(filePath),
|
||||
);
|
||||
await watchFolders(watchedFolders, async (event, filePath) => {
|
||||
console.log(`${filePath}:${event} triggering rebuild...`);
|
||||
const filePathForLog = filePath || "<UNKNOWN_FILE>";
|
||||
const eventForLog = event || "<UNKNOWN_EVENT>";
|
||||
console.log(
|
||||
`${filePathForLog}:${eventForLog} triggering rebuild...`,
|
||||
);
|
||||
await rebuild();
|
||||
if (wsServer != null) {
|
||||
console.log(`rebuild finished, reloading browsers...`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue