sliftutils 1.2.14 → 1.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builders/hotReload.ts +6 -3
- package/package.json +1 -1
package/builders/hotReload.ts
CHANGED
|
@@ -81,7 +81,7 @@ function chromeExtensionBackgroundHotReload(port = DEFAULT_WATCH_PORT) {
|
|
|
81
81
|
|
|
82
82
|
watchPortHotReload(port, () => { /* unused — hash callback drives reloads */ }, (hash) => {
|
|
83
83
|
if (!hash) return;
|
|
84
|
-
chrome.storage.local.set({ [HOT_RELOAD_HASH_STORAGE_KEY]: hash });
|
|
84
|
+
void chrome.storage.local.set({ [HOT_RELOAD_HASH_STORAGE_KEY]: hash });
|
|
85
85
|
if (currentHash === undefined) {
|
|
86
86
|
currentHash = hash;
|
|
87
87
|
console.log(`[Hot Reload] Initial build hash: ${hash}`);
|
|
@@ -101,7 +101,10 @@ function chromeExtensionContentScriptHotReload() {
|
|
|
101
101
|
setInterval(() => {
|
|
102
102
|
try {
|
|
103
103
|
chrome.storage.local.get(HOT_RELOAD_HASH_STORAGE_KEY, (result) => {
|
|
104
|
-
if (chrome.runtime.lastError)
|
|
104
|
+
if (chrome.runtime.lastError) {
|
|
105
|
+
console.error("[Hot Reload] storage.get error:", chrome.runtime.lastError.message);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
105
108
|
let hash: string | undefined = result?.[HOT_RELOAD_HASH_STORAGE_KEY];
|
|
106
109
|
if (!hash) return;
|
|
107
110
|
if (lastHash === undefined) {
|
|
@@ -115,7 +118,7 @@ function chromeExtensionContentScriptHotReload() {
|
|
|
115
118
|
}
|
|
116
119
|
});
|
|
117
120
|
} catch (error) {
|
|
118
|
-
|
|
121
|
+
console.error("[Hot Reload] poll error:", (error as Error).stack ?? error);
|
|
119
122
|
}
|
|
120
123
|
}, CONTENT_SCRIPT_POLL_INTERVAL_MS);
|
|
121
124
|
}
|