diff --git a/.gitignore b/.gitignore index 76add87..c2dd9a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -dist \ No newline at end of file +dist +.vscode \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index fde6634..a181125 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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); } }; };