From f6acd72ab519d78fe5399b17f6158d1d224a101c Mon Sep 17 00:00:00 2001 From: Gigiaj Date: Sun, 8 Jun 2025 20:10:05 -0500 Subject: [PATCH] Add isProduction to determine the behavior to use for the SW --- src/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index da60808a..a65466e2 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -18,10 +18,9 @@ import './app/i18n'; document.body.classList.add(configClass, varsClass); -// Register Service Worker if ('serviceWorker' in navigator) { - const swUrl = - import.meta.env.MODE === 'production' + const isProduction = import.meta.env.MODE === 'production'; + const swUrl = isProduction ? `${trimTrailingSlash(import.meta.env.BASE_URL)}/sw.js` : `/dev-sw.js?dev-sw`;