Skip to content

Commit

Permalink
fix/breaking view scripts on code reload for Windows (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrykKuniczak authored Nov 9, 2023
1 parent 2cd0929 commit 8dd19bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/reload/initReloadServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ const debounceSrc = debounce(function (path: string) {
);
// Delay waiting for public assets to be copied
}, 400);
chokidar.watch('src').on('all', (event, path) => debounceSrc(path));
chokidar.watch('src', { ignorePermissionErrors: true }).on('all', (_, path) => debounceSrc(path));

/** CHECK:: build was completed **/
const debounceDist = debounce(() => {
clientsThatNeedToUpdate.forEach((ws: WebSocket) => {
ws.send(MessageInterpreter.send({ type: UPDATE_REQUEST_MESSAGE }));
});
}, 100);
chokidar.watch('dist').on('all', event => {
chokidar.watch('dist', { ignorePermissionErrors: true }).on('all', event => {
// Ignore unlink, unlinkDir and change events
// that happen in beginning of build:watch and
// that will cause ws.send() if it takes more than 400ms
Expand Down

0 comments on commit 8dd19bd

Please sign in to comment.