Prevent infinite reloading service worker (#2785)

* Respect interval for service worker

* Do not load sw by vie plugin

* Move comment above
This commit is contained in:
Patryk Andrzejewski 2022-12-06 11:12:19 +01:00 committed by GitHub
parent 04b93cdc9b
commit 018b93aaa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -6,7 +6,7 @@ export const getAppDefaultUri = () => "/";
export const getAppMountUri = () =>
window.__SALEOR_CONFIG__.APP_MOUNT_URI || getAppDefaultUri();
export const getApiUrl = () => window.__SALEOR_CONFIG__.API_URL;
export const SW_INTERVAL = parseInt(process.env.SW_INTERVAL, 10);
export const SW_INTERVAL = parseInt(process.env.SW_INTERVAL, 10) || 300;
export const IS_CLOUD_INSTANCE = process.env.IS_CLOUD_INSTANCE === "true";
export const MARKETPLACE_URL = window.__SALEOR_CONFIG__.MARKETPLACE_URL;
export const MARKETPLACE_SALEOR_APPS_PAGE_PATH =

View file

@ -70,6 +70,10 @@ export default defineConfig(({ command, mode }) => {
plugins.push(
VitePWA({
/*
We use 'register-service-worker' for registering sw.js.
*/
injectRegister: null,
strategies: "injectManifest",
/*