Skip to content

Commit

Permalink
Merge pull request #3 from isaurssaurav/issue/#2
Browse files Browse the repository at this point in the history
fix(#2): add buffer time to reload the extension
  • Loading branch information
isaurssaurav authored Oct 28, 2023
2 parents 72e6a06 + 4e4a8b0 commit 6c6dae9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
dist
.vscode
8 changes: 5 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ const hotReloadExtension = (options: hotReloadExtensionOptions): Plugin => {
chalkLogger.red('Load extension to browser...');
return;
}
// TODO BUG: when user triggers watch before previous build is completed, the extension crashes
ws?.send(Message.FILE_CHANGE);
if (log) chalkLogger.green('Extension Reloaded...');

setTimeout(() => {
ws?.send(Message.FILE_CHANGE);
if (log) chalkLogger.green('Extension Reloaded...');
}, 1000);
}
};
};
Expand Down

0 comments on commit 6c6dae9

Please sign in to comment.