Настроить локальный запуск UI с devnet сервером

This commit is contained in:
AidarKC
2026-10-10 17:19:47 +03:00
parent 4d10096ba2
commit 07ddaf5e4c
4 changed files with 120 additions and 13 deletions
+10 -3
View File
@@ -39,7 +39,7 @@
}());
</script>
<script>
window.__SHINE_BUILD_HASH__ = '20261007235900';
window.__SHINE_BUILD_HASH__ = '20261010170500';
window.__SHINE_CLIENT_VERSION__ = '1.2.10';
</script>
<script>
@@ -445,11 +445,18 @@ window.__SHINE_BUILD_HASH__ = '20261007235900';
}());
</script>
<script>
(function attachAppWithBuildHash() {
(async function attachAppWithBuildHash() {
const isLocalPreview = ['localhost', '127.0.0.1', '::1'].includes(String(window.location.hostname || '').toLowerCase());
if (isLocalPreview && 'serviceWorker' in navigator) {
try {
const registrations = await navigator.serviceWorker.getRegistrations();
await Promise.all(registrations.map((registration) => registration.unregister()));
} catch {}
}
const v = encodeURIComponent(window.__SHINE_BUILD_HASH__ || 'dev');
const script = document.createElement('script');
script.type = 'module';
script.src = `./js/app.js?v=${v}`;
script.src = isLocalPreview ? `./js/app.js?v=${v}&local=${Date.now()}` : `./js/app.js?v=${v}`;
document.body.appendChild(script);
}());
</script>