@allurereport/static-server 3.19.1 → 3.20.1

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.
Files changed (2) hide show
  1. package/dist/utils.js +8 -1
  2. package/package.json +2 -2
package/dist/utils.js CHANGED
@@ -906,9 +906,16 @@ export const injectLiveReloadScript = (html) => {
906
906
 
907
907
  eventSource.onmessage = () => {
908
908
  const newHash = Math.random().toString(36).slice(2, 10);
909
+ const reload = () => window.location.reload();
909
910
 
910
911
  window.localStorage.setItem("${ALLURE_LIVE_RELOAD_HASH_STORAGE_KEY}", newHash);
911
- window.location.reload();
912
+
913
+ if (typeof window.__allureLiveReload !== "function") {
914
+ reload();
915
+ return;
916
+ }
917
+
918
+ Promise.resolve(window.__allureLiveReload()).catch(reload);
912
919
  };
913
920
  </script>
914
921
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/static-server",
3
- "version": "3.19.1",
3
+ "version": "3.20.1",
4
4
  "description": "Minimalistic web-server for serving static files",
5
5
  "keywords": [
6
6
  "allure",
@@ -32,7 +32,7 @@
32
32
  "lint:fix": "oxlint --import-plugin --fix src test features stories"
33
33
  },
34
34
  "dependencies": {
35
- "@allurereport/directory-watcher": "3.19.1",
35
+ "@allurereport/directory-watcher": "3.20.1",
36
36
  "open": "^11.0.0"
37
37
  },
38
38
  "devDependencies": {