mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +03:00
Add isProduction to determine the behavior to use for the SW
This commit is contained in:
parent
ca026bf947
commit
f6acd72ab5
1 changed files with 2 additions and 3 deletions
|
|
@ -18,10 +18,9 @@ import './app/i18n';
|
||||||
|
|
||||||
document.body.classList.add(configClass, varsClass);
|
document.body.classList.add(configClass, varsClass);
|
||||||
|
|
||||||
// Register Service Worker
|
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
const swUrl =
|
const isProduction = import.meta.env.MODE === 'production';
|
||||||
import.meta.env.MODE === 'production'
|
const swUrl = isProduction
|
||||||
? `${trimTrailingSlash(import.meta.env.BASE_URL)}/sw.js`
|
? `${trimTrailingSlash(import.meta.env.BASE_URL)}/sw.js`
|
||||||
: `/dev-sw.js?dev-sw`;
|
: `/dev-sw.js?dev-sw`;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue